i'm not completely sure i understand your problem but i think you are looking for something like this: http://pocoproject.org/docs/Poco.DynamicAny.html maybe the c++ source code could be of some inspiration. this should be possible in d, too.