[Issue 17445] Disagreement between 'static assert' and 'static if'

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat May 27 15:10:42 PDT 2017


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

Stanislav Blinov <stanislav.blinov at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stanislav.blinov at gmail.com

--- Comment #2 from Stanislav Blinov <stanislav.blinov at gmail.com> ---
There are isCopyable and isAssignable traits in std.traits.
Or you can roll your own:

enum bool isCopyable(T) = is(typeof(() { T* a, b; *a = *b; }));

using pointers in case e.g. the default ctor is disabled.

--


More information about the Digitalmars-d-bugs mailing list