digitalmars.D - Transfering CTFE classes to runtime
- Robert Clipsham (19/19) Mar 31 2012 Hi all,
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/
Mar 31 2012