How to import for mixin contents only.

Andrea Fontana via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Mar 10 14:07:23 PST 2016


On Thursday, 10 March 2016 at 17:43:08 UTC, Taylor Hillegeist 
wrote:
> I suppose the linker optimized the functions away since they 
> are now in their own section. But it seems a hacky way to do 
> this.

AFAIK assert(0) and other falsey assert have a special meaning 
for compiler.
So probably it's not so hacky but just a way to say that case 
can't happen.

It is used also for:


auto myfunc(int i)
{

    if (i == 0) return 10;
    else if (i == 1) return 3;

    assert(0);
}

And also with non final switch using

switch(var)
{
    case ...
...
    default: assert(0);
}


More information about the Digitalmars-d-learn mailing list