2
0
mirror of https://github.com/boostorg/tti.git synced 2026-01-26 07:02:14 +00:00
Files
tti/test/test_has_mem_data_compile.cpp
Edward Diener 62d9696840 Updated tests and header file inclusion.
[SVN r69815]
2011-03-10 02:44:14 +00:00

26 lines
955 B
C++

#include "test_has_mem_data.hpp"
#include <boost/mpl/assert.hpp>
int main()
{
// You can always instantiate without compiler errors
BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)<AType,long> aVar;
BOOST_TTI_HAS_MEMBER_DATA_GEN(someDataMember)<AnotherType,double> aVar2;
// Compile time asserts
BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)<AType,int>));
BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(AnInt)<AnotherType,long>));
BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(aMember)<AnotherType,bool>));
BOOST_MPL_ASSERT((BOOST_TTI_TRAIT_GEN(CMember)<AnotherType,bool>));
BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(IntBT)<AType,AType::BType>));
BOOST_MPL_ASSERT((BOOST_TTI_TRAIT_GEN(NestedData)<AType,AType::BType::CType>));
BOOST_MPL_ASSERT((BOOST_TTI_TRAIT_GEN(AOther)<AnotherType,AType>));
BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_DATA_GEN(ONestStr)<AnotherType,AType::AStructType>));
return 0;
}