addRepresenter is now pure.

This commit is contained in:
Ferdinand Majerech 2013-12-17 15:15:36 +01:00
parent ab9ba7f5ba
commit 7be10a44bf

View file

@ -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;
}