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
