mattkretz / wg21-papers

my papers to WG21 — the C++ committee
5 stars 7 forks source link

Constrained operations which rely on ordering to only overload when their values can be totally_ordered #86

Closed danieltowner closed 1 year ago

danieltowner commented 1 year ago

Not sure whether this is really the right wording, but it captures where suitable wording needs to be added.

Alternative wording could be to say that min is constrained by having operator< defined for T, but simd::min doesn't actually have to be implemented in terms of operator< at all. T::value_type doesn't have to define operator< either, and wouldn't be implemented in terms of operator<(value_type, value_type) either. The constraint is really on whether it makes sense to compare to value_types in a mathemetical sense, rather than something that actually provides all the right operators, but I'm not sure of the best way to say that.