What is @return?

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 28 21:02:58 PST 2015


On Thu, 29 Jan 2015 04:54:38 +0000, Jesse Phillips wrote:

> 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.

http://wiki.dlang.org/DIP25
this is a very recent thing, it wasn't coded when 2.066 was released.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150129/c691f79b/attachment.sig>


More information about the Digitalmars-d-learn mailing list