isInputRange as a __traits ?

drug drug2004 at bk.ru
Sat Oct 7 10:36:21 UTC 2017


07.10.2017 13:31, user1234 пишет:
> Since the compiler has the ability to detect input ranges in the foreach 
> aggregate that are aggregates implementing the right primitives, why 
> don't you set the widely used std.range.isInputRange as a __trait, e.g 
> __traits(isInputRange, Stuff) ?

IIRC the reason is if something could be done in library it should be 
done in library. Just to avoid making compiler more complex than it's 
necessary.
As for me isInputRange!Stuff is better than __traits(isInputRange, Stuff).


More information about the Digitalmars-d mailing list