Summary: Can't return ref T where T has const/immutable members
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD

--- Comment #0 from Denis <> 2011-07-16 08:19:56 PDT 
As a result "front" and "back" template functions from std.array don't compile,
isInputRange!(S[]) is false and none of range functions can work with an array
of structs with a const/immutable member.

immutable struct IS { int t; }
struct S { immutable int t; }

void f(ref S) { } //compiles
ref IS f() { return IS(); } //compiles too
ref S f() { return S(); } //doesn't compile

void main() {
    static assert( isInputRange!(S[]) ); //as a result assertion failure

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to