www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Transfering CTFE classes to runtime

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:


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.

Mar 31 2012