From 7be10a44bf20dc7ce4f47c254931396d38dc8b42 Mon Sep 17 00:00:00 2001 From: Ferdinand Majerech Date: Tue, 17 Dec 2013 15:15:36 +0100 Subject: [PATCH] addRepresenter is now pure. --- source/dyaml/representer.d | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/dyaml/representer.d b/source/dyaml/representer.d index f90f7f4..6a88ee5 100644 --- a/source/dyaml/representer.d +++ b/source/dyaml/representer.d @@ -224,10 +224,11 @@ final class Representer * } * -------------------- */ - void addRepresenter(T)(Node function(ref Node, Representer) representer) @trusted + void addRepresenter(T)(Node function(ref Node, Representer) representer) + @trusted pure { assert((typeid(T) in representers_) is null, - "Representer function for data type " ~ typeid(T).toString() ~ + "Representer function for data type " ~ T.stringof ~ " already specified. Can't specify another one"); representers_[typeid(T)] = representer; }