[Issue 3756] std.traits.ReturnType broken for ref returns

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 21 07:30:48 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=3756


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich at gmail.com
         Resolution|                            |FIXED


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-12-21 07:30:46 PST ---
Type modifiers can't be passed around in the language, but I think there's a
separate issue already opened for this.

Anyway you can do:

import std.traits;

ref uint foo(ref uint num) {
    return num;
}

void main()
{
    alias FunctionAttribute FA;
    static assert(functionAttributes!foo & FA.ref_);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list