Transfering CTFE classes to runtime
Robert Clipsham
robert at octarineparrot.com
Sat Mar 31 14:35:41 PDT 2012
Hi all,
I recently had a need to use some classes from CTFE so I made a couple
of helper methods to do just that:
https://github.com/mrmonday/misc/blob/master/transfer.d
Basic usage:
----
enum prepared = prepare(new MyClass);
auto transferred = transfer!MyClass(prepared);
----
It's rather rough and under-documented, could be of use though.
Known issues:
* Classes which have member variables of class types don't work
* Classes must have a default constructor
* transfer() requires the type parameter to be of the same class as used
at compile time - super classes won't work.
They shouldn't be too hard to resolve for the most part though.
--
Robert
http://octarineparrot.com/
More information about the Digitalmars-d
mailing list