Skip to content

Commit

Permalink
Enforce [alg.three.way]/2 mandate (#4878)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaseyCarter authored Aug 8, 2024
1 parent b5285d1 commit 938bd59
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -5826,6 +5826,10 @@ using _Lex_compare_three_way_memcmp_classify =
_EXPORT_STD template <class _InIt1, class _InIt2, class _Cmp>
_NODISCARD constexpr auto lexicographical_compare_three_way(const _InIt1 _First1, const _InIt1 _Last1,
const _InIt2 _First2, const _InIt2 _Last2, _Cmp _Comp) -> decltype(_Comp(*_First1, *_First2)) {
static_assert(
_Classify_category<decltype(_Comp(*_First1, *_First2))> != _Comparison_category::_Comparison_category_none,
"The result of the comparator must have comparison category type (N4988 [alg.three.way]/2).");

_STD _Adl_verify_range(_First1, _Last1);
_STD _Adl_verify_range(_First2, _Last2);
auto _UFirst1 = _STD _Get_unwrapped(_First1);
Expand Down

0 comments on commit 938bd59

Please sign in to comment.