On Wednesday, 22 April 2015 at 19:37:21 UTC, Steven Schveighoffer wrote:
Yeah, I like this. But now we have to name the flag :)

I don't think it should be a bool, because:

isInputRange!(R, true)

Is pretty obtuse. I'd rather see something like:

isInputRange!(R, RangeOption.NonCopyable)

Or whatever name we come up with.

The nice thing about this solution is that the range options could be passed down the trait chain, so isForwardRange easily gets this ability as well.

-Steve

I don't like that, because this is NOT an input range, it is something inferior but it is enough that some algorithms happen to work also on this crippled input range. And option would indicate that it has some extra features over and above what a general input range provides, which is not the case. This would require to change the code of every algorithm taking input ranges to check if the range is copyable - exactly what we don't wanted!

I would name it clumsy "isNonCopyableInputRange", and change only those algorithms that can cope with such a thing.

Reply via email to