• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 //  (C) Copyright Edward Diener 2011
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_mem_data.hpp"
8 #include <boost/mpl/assert.hpp>
9 
main()10 int main()
11   {
12 
13   // You can always instantiate without compiler errors
14 
15   BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)<AType,long> aVar;
16   BOOST_TTI_HAS_MEMBER_DATA_GEN(someDataMember)<AnotherType,double> aVar2;
17 
18   // Compile time asserts
19 
20   BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)<AType,int>));
21   BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)<AnotherType,long>));
22   BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)<AnotherType,bool>));
23   BOOST_MPL_ASSERT((CMember<AnotherType,bool>));
24   BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(IntBT)<AType,AType::BType>));
25   BOOST_MPL_ASSERT((NestedData<AType,AType::BType::CType>));
26   BOOST_MPL_ASSERT((AOther<AnotherType,AType>));
27   BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(ONestStr)<AnotherType,AType::AStructType>));
28 
29   return 0;
30 
31   }
32