1 2 // (C) Copyright Edward Diener 2019 3 // Use, modification and distribution are subject to the Boost Software License, 4 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at 5 // http://www.boost.org/LICENSE_1_0.txt). 6 7 #include "test_has_union.hpp" 8 #include <boost/detail/lightweight_test.hpp> 9 main()10int main() 11 { 12 13 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(AnIntType)<AType>::value); 14 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(AnIntTypeReference)<AType>::value); 15 BOOST_TEST(!NameStruct<AType>::value); 16 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(BType)<AType>::value); 17 BOOST_TEST(!TheInteger<AType::BType>::value); 18 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(CType)<AType::BType>::value); 19 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(AnotherIntegerType)<AType::BType::CType>::value); 20 BOOST_TEST(!SomethingElse<AnotherType>::value); 21 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(NoOtherType)<AnotherType>::value); 22 23 BOOST_TEST(BOOST_TTI_HAS_UNION_GEN(CTypeUnion)<AType::BType::CType>::value); 24 BOOST_TEST(SimpleUT<AType>::value); 25 BOOST_TEST(BOOST_TTI_HAS_UNION_GEN(AnotherUnion)<AnotherType>::value); 26 27 BOOST_TEST(!EInB<AType::BType>::value); 28 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(AnEnumTtype)<AType>::value); 29 BOOST_TEST(!AnotherE<AnotherType>::value); 30 BOOST_TEST(!EClass<AType>::value); 31 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(AnotherEnumClassType)<AnotherType>::value); 32 33 BOOST_TEST(BOOST_TTI_HAS_UNION_GEN(InnerUnion)<AnotherType::AnotherUnion>::value); 34 35 // Passing non-class enclosing type will return false 36 37 BOOST_TEST(!BOOST_TTI_HAS_UNION_GEN(AnIntTypeReference)<signed long>::value); 38 BOOST_TEST(!NameStruct<AType &>::value); 39 40 return boost::report_errors(); 41 42 } 43