[Issue 17387] static struct this(ref) not pure

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue May 9 08:23:08 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17387

ag0aep6g at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |ag0aep6g at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from ag0aep6g at gmail.com ---
You have to mark the constructor as `pure`:

    struct S { this(ref int val) pure { ++val; } }

Attributes are only inferred under special circumstances. You generally have to
be explicit with them. Closing as invalid. Please reopen if I'm missing the
point.

--


More information about the Digitalmars-d-bugs mailing list