What is @return?

Jesse Phillips via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 28 20:54:38 PST 2015


A recent discussion over in digitalmars.D
http://forum.dlang.org/post/rtwbtxigfeupvykpbamh@forum.dlang.org

talks about accepting @return... Here is an example from the PR:
https://github.com/D-Programming-Language/dmd/compare/366422338ece...6b86b12f79e8

struct At
{
  @property auto info() @safe @nothrow @pure @return const { 
return this; }

  @pure @nothrow @return ref int info2(ref int x) { return x; }
}

Which I assume before the change would be:

struct At
{
  @property auto info() @safe nothrow pure return const { return 
this; }

  pure nothrow return ref int info2(ref int x) { return x; }
}

I don't know about anyone else, but this doesn't compile in 2.066.


More information about the Digitalmars-d-learn mailing list