www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10372] New: Document NRVO is applied in simple cases

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

           Summary: Document NRVO is applied in simple cases
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com
        Depends on: 10371



12:41:03 MSD ---
If documentation will guarantee NRVO is applied in simple cases (i.e. no copy
construction occurs) structs with disabled default construction will be able to
be returned from functions (currently it is not guaranteed to compile):
---
struct S
{  disable this(this); }

S makeS()
{
    S s = S();
    return s;
}

void main()
{
    S s = makeS();
}
---

Also Issue 10371 have to be fixed first.

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