On Thu, Jan 24, 2013 at 10:34 PM, Rob T <al...@ucora.com> wrote: > On Thursday, 24 January 2013 at 18:41:31 UTC, mist wrote: >> >> You can use "magic" functions __ctor and __dtor which actually serve as >> constructor and destructor implementations behind the scene. >> >> Example and proof-of-concept: http://dpaste.1azy.net/fd924332 >> >> Have no idea if it is explicitly defined by spec somewhere though. > > > If you have more than one ctor it seems to take the first one > > http://dpaste.1azy.net/b994fdf3 > > I don't know if you will able to rely on the order unless it's a part of the > spec.
IIRC, you can use __traits(getOverloads, mytype.__ctor) to get all constructor overloads. See: http://dlang.org/traits.html#getOverloads I used this in conjunction with __traits(getMember, ...) to get the entire list of member, overloads included.