On Tuesday, 3 February 2015 at 18:16:20 UTC, Andrei Alexandrescu wrote:
I think the best route here - and the most in-the-spirit-of-D - is to provide introspection on whether a function is being inlined or not. Then we can always have in libraries:

bool uart(ubyte b)
{
    static assert(__traits(inlined),
      "Inlining of uart() must be supported.");
    ...
}

That is tempting path but I feel that it creates new issues for little benefit.

Consider:

bool uart(ubyte b)
{
    static if(__traits(inlined))
    {
        // do something that can't be inlined
    }
    else
    {
        // do something that can be inlined
    }
}

And http://wiki.dlang.org/DIP56 is still needed for other purposes - so why create new brittle abstractions when it is possible to use existing dumb ones?

Reply via email to