Idea: Context sensitive attribute functions.

12345swordy alexanderheistermann at gmail.com
Tue Jun 19 19:03:44 UTC 2018


Pseudocode:
void example()
{
static if(Context = @nogc)
{
//nogc implementation
}
else
{
//gc implementation
}
}

This is useful as it eliminate the need to create multiple 
functions for each possible system attribute hence reducing 
redundant code. There are advantages of having a gc/unsafe/throw 
code. Why not use them if given the opportunity based on its 
context?

- Alex


More information about the Digitalmars-d mailing list