// Copyright 2026 Peter Dimov // Distributed under the Boost Software License, Version 1.0. // https://www.boost.org/LICENSE_1_0.txt #include #include #if defined(BOOST_MSVC) && BOOST_MSVC < 1920 BOOST_PRAGMA_MESSAGE( "Test skipped, because BOOST_MSVC < 1920" ) int main() {} #else #include #include #include #include using boost::variant2::detail::has_le; using namespace boost::variant2; struct X1 { }; struct X2 { bool operator<=( X2 const& ) const = delete; }; struct X3 { void operator<=( X3 const& ) const; }; struct X4 { bool operator<=( X4 const& ) const; }; int main() { BOOST_TEST_TRAIT_FALSE(( has_le< X1 > )); BOOST_TEST_TRAIT_FALSE(( has_le< X2 > )); BOOST_TEST_TRAIT_FALSE(( has_le< X3 > )); BOOST_TEST_TRAIT_TRUE(( has_le< X4 > )); BOOST_TEST_TRAIT_FALSE(( has_le< variant > )); BOOST_TEST_TRAIT_FALSE(( has_le< variant > )); BOOST_TEST_TRAIT_FALSE(( has_le< variant > )); BOOST_TEST_TRAIT_TRUE(( has_le< variant > )); return boost::report_errors(); } #endif