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/mpl/assert.hpp>
9
10int main()
11 {
12
13 // You can always instantiate without compiler errors
14
15 BOOST_TTI_HAS_DATA_GEN(aMember)<AType,long> aVar;
16 BOOST_TTI_HAS_DATA_GEN(SomeStaticData)<AnotherType,long> aVar2;
17 BOOST_TTI_HAS_DATA_GEN(someDataMember)<AnotherType,double> aVar3;
18
19 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(AnInt)<AType,int>));
20 BOOST_MPL_ASSERT_NOT((BOOST_TTI_HAS_DATA_GEN(SomeStaticData)<AnotherType,float>));
21 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(AnInt)<AnotherType,long>));
22 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(DSMember)<AType,short>));
23 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(aMember)<AnotherType,bool>));
24 BOOST_MPL_ASSERT_NOT((BOOST_TTI_HAS_DATA_GEN(aMember)<AnotherType,int>));
25 BOOST_MPL_ASSERT((DCMember<AnotherType,bool>));
26 BOOST_MPL_ASSERT_NOT((BOOST_TTI_HAS_DATA_GEN(someDataMember)<AType,short>));
27 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(IntBT)<AType,AType::BType>));
28 BOOST_MPL_ASSERT((DStatName<AnotherType,AType::AStructType>));
29 BOOST_MPL_ASSERT((DNestedData<AType,AType::BType::CType>));
30 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(CIntValue)<AnotherType,const int>));
31 BOOST_MPL_ASSERT((DAOther<AnotherType,AType>));
32 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(ONestStr)<AnotherType,AType::AStructType>));
33
34#if !defined(BOOST_NO_CXX11_UNRESTRICTED_UNION)
35
36 BOOST_MPL_ASSERT((BOOST_TTI_HAS_DATA_GEN(USMember)<AType::AnUnion,float>));
37 BOOST_MPL_ASSERT((SomeUStaticD<AnotherType::AnotherUnion,char>));
38
39#endif
40
41
42 return 0;
43
44 }
45

source code of boost/libs/tti/test/test_has_data_compile.cpp