RFC: DIP draft for "Compiler-defined Attribute Consistency"

Alexandru Ermicioi alexandru.ermicioi at gmail.com
Fri Jul 16 10:52:07 UTC 2021


On Friday, 16 July 2021 at 10:17:39 UTC, vit wrote:

> And make attributes symbols:

If they are UDA, then they are symbols.
I.e in object.d you'd have struct defs for each lang defined 
attribute:

```
struct safe {...}
struct nogc {...}
struct deprecated {...}
```

This consequently means that you can employ them in a template 
like in your example, or ctfe function that is put as an 
annotation:

```
void textedDeprecate(T...)(T args) {
   return deprecated(text(args));
}

@textedDeprecate("this is obsolete since ", 1.0)
struct Obsolete {
}
```


More information about the Digitalmars-d mailing list