[Issue 9489] writeln of struct with disabled copy ctor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Feb 9 05:44:29 PST 2013


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com
            Summary|writeln of scoped class     |writeln of struct with
                   |instance                    |disabled copy ctor


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-02-09 05:44:27 PST ---
Unrelated to scoped classes, the root cause is that writeln() takes its
arguments by value:

import std.stdio;

struct S
{
    @disable this(this);
}

void main()
{
    S s;
    writeln(s);  // error
}

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