• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 //  (C) Copyright Edward Diener 2012
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_data.hpp"
8 #include <boost/detail/lightweight_test.hpp>
9 
main()10 int main()
11   {
12 
13   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(AnInt)<AType,int>::value));
14   BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(SomeStaticData)<AnotherType,float>::value));
15   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(AnInt)<AnotherType,long>::value));
16   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(DSMember)<AType,short>::value));
17   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(aMember)<AnotherType,bool>::value));
18   BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(aMember)<AnotherType,int>::value));
19   BOOST_TEST((DCMember<AnotherType,bool>::value));
20   BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(someDataMember)<AType,short>::value));
21   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(IntBT)<AType,AType::BType>::value));
22   BOOST_TEST((DStatName<AnotherType,AType::AStructType>::value));
23   BOOST_TEST((DNestedData<AType,AType::BType::CType>::value));
24   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(CIntValue)<AnotherType,const int>::value));
25   BOOST_TEST((DAOther<AnotherType,AType>::value));
26   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(ONestStr)<AnotherType,AType::AStructType>::value));
27 
28 #if !defined(BOOST_NO_CXX11_UNRESTRICTED_UNION)
29 
30   BOOST_TEST((BOOST_TTI_HAS_DATA_GEN(USMember)<AType::AnUnion,float>::value));
31   BOOST_TEST((SomeUStaticD<AnotherType::AnotherUnion,char>::value));
32 
33 #endif
34 
35   // Passing non-class enclosing type will return false
36 
37   BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(IntBT)<unsigned long,AType::BType>::value));
38   BOOST_TEST((!DCMember<AnotherType *,bool>::value));
39   BOOST_TEST((!DCMember<AnotherType &,bool>::value));
40   BOOST_TEST((!BOOST_TTI_HAS_DATA_GEN(AnInt)<int **,long>::value));
41 
42   return boost::report_errors();
43 
44   }
45