2
0
mirror of https://github.com/boostorg/tti.git synced 2026-01-26 19:12:11 +00:00
Files
tti/test/TestHasMemberCompile.cpp
Edward Diener 31a0db5320 Updated tests
[SVN r67200]
2010-12-13 03:45:05 +00:00

29 lines
1.1 KiB
C++

#include "TestHasMember.hpp"
#include <boost/mpl/assert.hpp>
int main()
{
// You can always instantiate without compiler errors
tti::has_member_aMember<long AType::*> aVar;
tti::has_member_someDataMember<double AnotherType::*> aVar2;
tti::has_member_someFunctionMember<double (AnotherType::*)(short,short,long,int)> aVar3;
// Compile time asserts
BOOST_MPL_ASSERT((tti::has_member_AnInt<int AType::*>));
BOOST_MPL_ASSERT((tti::has_member_AnInt<long AnotherType::*>));
BOOST_MPL_ASSERT((tti::has_member_VoidFunction<void (AType::*)()>));
BOOST_MPL_ASSERT((tti::has_member_IntFunction<int (AType::*)()>));
BOOST_MPL_ASSERT((tti::has_member_IntFunction<double (AnotherType::*)(int)>));
BOOST_MPL_ASSERT((tti::has_member_aFunction<AType (AnotherType::*)(int)>));
BOOST_MPL_ASSERT((tti::has_member_anotherFunction<int (AnotherType::*)(AType)>));
BOOST_MPL_ASSERT((tti::has_member_sFunction<AType::AnIntType (AnotherType::*)(int,long,double)>));
BOOST_MPL_ASSERT((tti::has_member_aMember<bool AnotherType::*>));
BOOST_MPL_ASSERT((tti::has_member_cMem<bool AnotherType::*>));
return 0;
}