Empty UDA for classes not allowed?

bauss jj_1337 at live.dk
Thu Oct 26 15:09:48 UTC 2017


Why is it not allowed to have empty UDAs for classes?

Let's say we have an UDA like this:
struct Exclude { }

Then we want to put it on a class like:

@Exclude class Foo
{
     ...
}

This will fail with the following error:
Error: type Exclude has no value

But on everything else we can place an empty UDA like that ex. on 
a function:

This is okay:

@Exclude void foo()
{
     ...
}

Can someone explain to me why it's not possible with classes?


More information about the Digitalmars-d-learn mailing list