What does 'inline' mean?

Avrina avrina12309412342 at gmail.com
Fri Jun 12 20:13:55 UTC 2020


On Friday, 12 June 2020 at 15:37:16 UTC, Andrei Alexandrescu 
wrote:
> On 6/11/20 11:01 PM, Avrina wrote:
>> On Friday, 12 June 2020 at 01:55:26 UTC, Manu wrote:
>>> Can you please explain why you feel opposed to this, and why 
>>> our existing
>>> solution, which is 'weird' by all accounts, and satisfies 
>>> ZERO of the goals
>>> assigned to inline is preferable?
>> 
>> You won't get a direct answer to this. You can't have a debate 
>> if he never presents an argument. Or rather in business, you 
>> don't have to deal with a problem if you don't acknowledge 
>> there is a problem, management 101.
>
> It seems to me the problem lies with the way the problem is 
> formulated.

You managed to figure it out :), at least better than Walter. 
When talking about inline, it seems even you and Walter seem to 
be focused on the "inline" part.

Yes an empty template does what Manu wants, the problem is that 
templates have their own nasty side effects.

    int  foo(int)  { return 1; }
    bool foo(bool) { return true; }

    int  bar()(int)  { return 1; }
    bool bar()(bool) { return true; }

    pragma(msg, __traits(getOverloads, __traits(parent, foo), 
"foo")); // tuple of (foo, foo)
    pragma(msg, __traits(getOverloads, __traits(parent, bar), 
"bar")); // empty tuple ()


It's relevant enough to be a feature that has already existed for 
quite some time. All Manu wants is to have that same 
functionality without the template. Maybe a bit different of an 
implementation but it does almost the same thing. There were also 
a few other examples of problems provided that were meant with 
unhelpful "workarounds" such as this: 
https://forum.dlang.org/post/rbua3s$1s5m$1@digitalmars.com Yes, 
just don't ever use enums and/or waste your time trying to figure 
out what is causing the link error and try to figure out a way to 
just remove it. So helpful.








More information about the Digitalmars-d mailing list