<div dir="ltr"><div dir="ltr">On Sat, Jun 13, 2020 at 1:25 PM Andrei Alexandrescu via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 6/12/20 8:52 PM, Manu wrote:<br>
> Except in the case I described as case #3, in which it would be useful <br>
> to have SOME WAY, to 'force inline' and receive an error if it failed.<br>
<br>
I recall a couple of compilers (TopSpeed, does anyone remember?) had <br>
such a feature. The warnings listing the arbitrary functions that failed <br>
whatever heuristics was utterly useless. No C++ compiler implements it <br>
today, and I don't think any should.<br></blockquote><div><br></div><div>I feel like I clearly agreed here too; I gave 3 cases which are distinct use cases. C++ implements #1 and #2, and uses the nomenclature `inline` for those cases.</div><div>What you're talking about here is case #3, which C++ doesn't support, and I agree C++ shouldn't try and jam this idea into `inline` because that has a confused history, and a fairly well defined present.</div><div>That doesn't mean that it's not a useful tool though, and one that I've wanted lots of times... but as I've made clear, I see this as a distinct use case, and should be explicit and distinct.</div><div><br></div><div>This #3 use case is what `pragma(inline)` is closest to today. We almost have the #3 thing that C++ doesn't have, and we have no way to express the #1-2 things that C++ does have.</div><div>If it's the case that `pragma(inline)` is designed to model #3, then we're still out in the dark with #1 and #2, which are the overwhelmingly more common use cases.</div></div></div>