[Issue 15320] static assert(__traits(compiles, xyz)) considered harmful

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Nov 12 03:22:34 PST 2015


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

John Colvin <john.loughran.colvin at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.loughran.colvin at gmail.
                   |                            |com

--- Comment #3 from John Colvin <john.loughran.colvin at gmail.com> ---
(In reply to Andrei Alexandrescu from comment #2)
> (In reply to John Colvin from comment #1)
> > You just mean in unittests, right? It's useful (necessary?) elsewhere.
> 
> Yah, unittests were the only use case I had in mind. What are others?

template constraints, sanity checks, only way of implementing some template
predicates (IIRC it appears quite a bit in std.range and std.traits for this).

--


More information about the Digitalmars-d-bugs mailing list