[Issue 12252] struct default constructors that execute code.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 28 05:07:32 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12252



--- Comment #3 from Remo <remotion4d at gmail.com> 2014-02-28 05:07:29 PST ---
Ok then why any other workarounds for this problem do not work too ?

Here is one possible workaround that does not work.
struct S
{
    @disable this();
    @disable this(this);

    this(int i){ }
    static S opCall(){
        S s = S(123);
        return s;
    }
}

This would help to find places in ported C++ code that need to be changed but
it does not compiles.

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


More information about the Digitalmars-d-bugs mailing list