2

Does c++20 defines something similar to std::less for default comparsons operator (<=>).

I would like define some datasructure with customizable comparator as map or unordered_map do.

template <class DefaultComparison = std::??????<Key>,
struct MyContainer ... 
Dewfy
  • 23,277
  • 13
  • 73
  • 121
  • @Tommy-XavierRobillard JFI documentation from cppreference.com have 0 mentioning about it on the corresponding page https://en.cppreference.com/w/cpp/language/default_comparisons But thank you anyway – Dewfy Sep 30 '22 at 15:16
  • @Dewfy I've found it by going std:less -> functional – bolov Sep 30 '22 at 15:36

1 Answers1

3

std::compare_three_way is what you are looking for.

bolov
  • 72,283
  • 15
  • 145
  • 224