isInputRange as a __traits ?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Sat Oct 7 10:40:16 UTC 2017


On Saturday, October 07, 2017 10:31:01 user1234 via Digitalmars-d wrote:
> 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) ?

Why? What would we gain from that?

In general, the idea has been to do as little as possible with __traits and
as much as possible in the library. And in theory, it was more or less the
idea that std.traits would wrap __traits such that you'd never actually use
__traits directly, but that's never quite happened.

- Jonathan M Davis



More information about the Digitalmars-d mailing list