Template constraints: opCmp and opUnary!"++"
Jakob Ovrum
jakobovrum at gmail.com
Fri Dec 20 21:37:05 PST 2013
On Friday, 20 December 2013 at 20:42:13 UTC, monarch_dodra wrote:
> AFAIK, there is no real difference, but "is(typeof())" is more
> "idiomatic" in phobos.
Most uses of `is(typeof())` were written before the `compiles`
trait was introduced. Add the cargo cult to that, and it's no
wonder that Phobos uses `is(typeof())` so liberally, but I think
the `compiles` trait shows intent better and benefits from fewer
parentheses.
However, there is the problem that uses of `__traits` are
supposed to be internal, not user-facing. We haven't made much
headway on that one.
More information about the Digitalmars-d-learn
mailing list