[Issue 2788] return val not passable via ref const in other method

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 1 06:31:34 PST 2011


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


Trass3r <mrmocool at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool at gmx.de
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #1 from Trass3r <mrmocool at gmx.de> 2011-03-01 06:28:43 PST ---
ref const doesn't make any sense with basic types.

But it makes sense for struct and static array temporaries.

The weird thing is struct literals count as lvalues in D2, so this works:

struct A {}
void foo(ref A a) {}
void main()
{
    foo(A());
}

while calling the following doesn't:
static A bar()
{
    return A();
}

foo(bar());

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