
Dave Abrahams wrote:
Bottom line, you'll add a conversion and a bunch of unnecessary requirements and end up with the exact same specification as before, namely, returns the first i for which *i == value.
I claim that "finds the first element in [first, last) that equals value" is a better way to say it.
I know, and I question this claim. Why is it better, when it says the exact same thing, while needing to impose unnecessary requirements to arrive at it? The current specification (ignoring the conversion issue for now, as it's separate) says: - when T is EqualityComparable, returns the first element that equals value; - otherwise, returns the first element *i for which *i == value. Your preferred replacement says: - when T is EqualityComparable, returns the first element that equals value; - otherwise, the behavior is undefined. Do tell me why it's better.