Overloading based on attributes - is it a good idea?

Manu turkeyman at gmail.com
Fri May 31 17:52:28 UTC 2019


On Thu, May 30, 2019 at 12:55 AM Ola Fosheim Grøstad via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Thursday, 30 May 2019 at 05:24:21 UTC, Manu wrote:
> > Right. nothrow is the only one that makes any sense at all to
> > me, I've thought that overloading on nothrow might be useful
> > once or twice. Otherwise... pure; like you say, @nogc;
>
> I wonder if overloading on nothrow could be better done as
> overloading on return value. Either you get "return value or
> exception" or you get "wrapped return value".
>
> What other use case is there?

out params. wrapping return values kinda sucks, inhibits RVO.
overloading on return value seems problematic... how would that work?



More information about the Digitalmars-d mailing list