forked from boostorg/algorithm
fix spaceship support macro check, proper order of includes in test
This commit is contained in:
@ -3,11 +3,11 @@
|
|||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
#include <boost/algorithm/clamp.hpp>
|
|
||||||
#include <boost/algorithm/is_clamped.hpp>
|
#include <boost/algorithm/is_clamped.hpp>
|
||||||
|
#include <boost/algorithm/clamp.hpp>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#ifdef __cpp_impl_three_way_comparison
|
#ifdef __cpp_impl_three_way_comparison &&__has_include(<compare>)
|
||||||
#include <compare>
|
#include <compare>
|
||||||
#endif
|
#endif
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -167,7 +167,7 @@ void test_constexpr() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cpp_impl_three_way_comparison
|
#ifdef __cpp_impl_three_way_comparison &&__has_include(<compare>)
|
||||||
struct custom_with_spaceship {
|
struct custom_with_spaceship {
|
||||||
int v;
|
int v;
|
||||||
auto operator<=>(const custom_with_spaceship&) const = default;
|
auto operator<=>(const custom_with_spaceship&) const = default;
|
||||||
@ -175,7 +175,7 @@ struct custom_with_spaceship {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void test_spaceship() {
|
void test_spaceship() {
|
||||||
#ifdef __cpp_impl_three_way_comparison
|
#ifdef __cpp_impl_three_way_comparison &&__has_include(<compare>)
|
||||||
// Inside the range, equal to the endpoints, and outside the endpoints.
|
// Inside the range, equal to the endpoints, and outside the endpoints.
|
||||||
const custom_with_spaceship c0(0);
|
const custom_with_spaceship c0(0);
|
||||||
const custom_with_spaceship c1(1);
|
const custom_with_spaceship c1(1);
|
||||||
|
Reference in New Issue
Block a user