custom attribute proposal (yeah, another one)

Piotr Szturmaj bncrbme at jadamspam.pl
Fri Apr 6 09:53:51 PDT 2012


Andrej Mitrovic wrote:
> On 4/6/12, Piotr Szturmaj<bncrbme at jadamspam.pl>  wrote:
>> Static opCall() should do the trick
>
> But it seems like a roundabout way to work around an implementation
> issue just to enable annotations.

What do you mean? You can also initialize structs without default 
contructor:

struct Author { string name = "empty"; }
// struct Author { string name; } - this works too

enum a = Author();
pragma(msg, a.name);
enum b = Author("test");
pragma(msg, b.name);

I don't think default constructors or opCall are _needed_ for annotations.

> Well anyway as long as we *get* annotations at some point, all will be fine. :)

I'm sure it will!


More information about the Digitalmars-d mailing list