Re: CTFE UFCs?

2015-04-15 Thread bitwise via Digitalmars-d-learn
On Tue, 14 Apr 2015 12:46:40 -0400, ketmar ket...@ketmar.no-ip.org wrote: On Tue, 14 Apr 2015 11:20:38 -0400, bitwise wrote: i believe that you can't do what you want in a way you want, 'cause UFCS is not working for template args. but you can do this: alias base(alias CC) =

Re: CTFE UFCs?

2015-04-15 Thread bitwise via Digitalmars-d-learn
On Tue, 14 Apr 2015 12:52:19 -0400, anonymous anonym...@example.com wrote: abstract class Refl { @property abstract string name() const; immutable(Refl) base() const; } class ClassRefl(T) : Refl { @property override string name() const { return T.stringof; }

Re: CTFE UFCs?

2015-04-15 Thread bitwise via Digitalmars-d-learn
On Tue, 14 Apr 2015 12:52:19 -0400, anonymous anonym...@example.com wrote: Parting thoughts: I don't know where you're heading with this. But so far I don't see what it would buy you over std.traits and TypeInfo/TypeInfo_Class. Forgot to mention support for runtime reflection. See here:

Re: CTFE UFCs?

2015-04-14 Thread ketmar via Digitalmars-d-learn
On Tue, 14 Apr 2015 11:20:38 -0400, bitwise wrote: i believe that you can't do what you want in a way you want, 'cause UFCS is not working for template args. but you can do this: alias base(alias CC) = reflect!(CC.baseName()); ... static const(Refl) baseRefl = base!refl; signature.asc

Re: CTFE UFCs?

2015-04-14 Thread anonymous via Digitalmars-d-learn
On Tuesday, 14 April 2015 at 15:20:37 UTC, bitwise wrote: When I uncomment the nicer syntax, I get the errors below: [1] Error: variable refl cannot be read at compile time [2] Error: CTFE failed because of previous errors in base class Base { double d = 0.4; } class Test : Base {

CTFE UFCs?

2015-04-14 Thread bitwise via Digitalmars-d-learn
Hi. I've been building a reflection library for D, but I've hit a snag. If anyone can help out, it would be much appreciated =D In the example below, the second line of main() retrieves the reflection of a base class. Everything is well and good. Now, I am trying to come up with a more