// 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_eq; 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_eq< X1 > )); BOOST_TEST_TRAIT_FALSE(( has_eq< X2 > )); BOOST_TEST_TRAIT_FALSE(( has_eq< X3 > )); BOOST_TEST_TRAIT_TRUE(( has_eq< X4 > )); BOOST_TEST_TRAIT_FALSE(( has_eq< variant > )); BOOST_TEST_TRAIT_FALSE(( has_eq< variant > )); BOOST_TEST_TRAIT_FALSE(( has_eq< variant > )); BOOST_TEST_TRAIT_TRUE(( has_eq< variant > )); return boost::report_errors(); } #endif