@@ -23,24 +23,36 @@ export struct base {
2323
2424} // namespace range_equality
2525
26+ // I would like to have the comparison bases just publicly derive from
27+ // `range_equality::base` to reuse the code, but that causes compile times to
28+ // get much worse.
29+
2630namespace lexicographical_comparison {
2731
28- export struct base : range_equality::base {
32+ export struct base {
2933 template <range T> requires bounded::ordered<range_value_t <T>>
3034 friend constexpr auto operator <=>(T const & lhs, T const & rhs) {
3135 return ::containers::lexicographical_compare_3way (lhs, rhs);
3236 }
37+ template <range T> requires bounded::equality_comparable<range_value_t <T>>
38+ friend constexpr auto operator ==(T const & lhs, T const & rhs) -> bool {
39+ return ::containers::equal (lhs, rhs);
40+ }
3341};
3442
3543} // namespace lexicographical_comparison
3644
3745namespace shortlex_comparison {
3846
39- export struct base : range_equality::base {
47+ export struct base {
4048 template <range T> requires bounded::ordered<range_value_t <T>>
4149 friend constexpr auto operator <=>(T const & lhs, T const & rhs) {
4250 return ::containers::shortlex_compare (lhs, rhs);
4351 }
52+ template <range T> requires bounded::equality_comparable<range_value_t <T>>
53+ friend constexpr auto operator ==(T const & lhs, T const & rhs) -> bool {
54+ return ::containers::equal (lhs, rhs);
55+ }
4456};
4557
4658} // namespace shortlex_comparison
0 commit comments