What to do when you want to add attributes to your class functions?

Kagamin spam at here.lot
Fri Sep 16 11:49:30 UTC 2022


Overridable functions there forward to templated functions:
```
void notify()
{
	notify!(typeof(this))(true);
}
void notify() shared
{
	notify!(typeof(this))(true);
}
```
So you make the templated function @nogc and add a @nogc method:
```
void notify()
{
	notify!(typeof(this))(true);
}
void notify() shared
{
	notify!(typeof(this))(true);
}
void notify2() shared @nogc
{
	notify!(typeof(this))(true);
}
```


More information about the Digitalmars-d mailing list