www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2622] New: ref returns not allowed in complex template

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2622

           Summary: ref returns not allowed in complex template
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: andrei metalanguage.com


import std.typecons;

struct Proxy(R...)
{
    Tuple!(int*, float*) ptrs;
    // enable this.at!(ct_constant)
    ref R[i] at(int i)();
}

void main()
{
    Proxy!(int, float) p;
    auto x = p.at!(1);
}

fails to compile with the error message:

variable test.Proxy!(int,float).Proxy.i only parameters or foreach declarations
can be ref


-- 
Jan 27 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2622


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla digitalmars.com  2009-03-11 14:57 -------
Fixed dmd 2.026


-- 
Mar 11 2009