Skip to content

Commit

Permalink
array: Only expose operator<=> if <compare> is available
Browse files Browse the repository at this point in the history
  • Loading branch information
qookei committed Feb 9, 2024
1 parent 1e053d7 commit 09cfc9d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/frg/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include <type_traits>
#include <tuple>

#if __has_include(<compare>)
# include <compare>
#endif

namespace frg {

template<class T, size_t N>
Expand Down Expand Up @@ -88,7 +92,10 @@ struct array {
}

bool operator==(const array &other) const = default;

#if __has_include(<compare>)
auto operator<=>(const array &other) const = default;
#endif
};

namespace details {
Expand Down

0 comments on commit 09cfc9d

Please sign in to comment.