Skip to content

Commit

Permalink
Disable <=> tests when <compare> isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
pdimov committed Jan 29, 2025
1 parent 84d0f84 commit 9b508e3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/array_thw_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
#include <boost/config/pragma_message.hpp>
#include <cstddef>

#if defined(__has_include)
# if __has_include(<compare>)
# define HAS_COMPARE
# endif
#endif

#if !defined(__cpp_impl_three_way_comparison)

BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is not defined" )
Expand All @@ -18,6 +24,11 @@ int main() {}
BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is defined to " BOOST_STRINGIZE(__cpp_impl_three_way_comparison) )
int main() {}

#elif !defined(HAS_COMPARE)

BOOST_PRAGMA_MESSAGE( "Test skipped because <compare> is not available" )
int main() {}

#else

template<class T, std::size_t N> void test()
Expand Down
11 changes: 11 additions & 0 deletions test/array_thw_test_cx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
#include <boost/config/workaround.hpp>
#include <cstddef>

#if defined(__has_include)
# if __has_include(<compare>)
# define HAS_COMPARE
# endif
#endif

#if !defined(__cpp_impl_three_way_comparison)

BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is not defined" )
Expand All @@ -18,6 +24,11 @@ int main() {}
BOOST_PRAGMA_MESSAGE( "Test skipped because __cpp_impl_three_way_comparison is defined to " BOOST_STRINGIZE(__cpp_impl_three_way_comparison) )
int main() {}

#elif !defined(HAS_COMPARE)

BOOST_PRAGMA_MESSAGE( "Test skipped because <compare> is not available" )
int main() {}

#else

#define STATIC_ASSERT(...) static_assert(__VA_ARGS__, #__VA_ARGS__)
Expand Down

0 comments on commit 9b508e3

Please sign in to comment.