1 2 // (C) Copyright Edward Diener 2011,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_mem_fun.hpp" 8 #include <boost/mpl/assert.hpp> 9 main()10int main() 11 { 12 13 // You can always instantiate without compiler errors 14 15 BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember)<double (AnotherType::*)(short,short,long,int)> aVar3; 16 17 // Compile time asserts 18 19 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction)<void (AType::*)()>)); 20 BOOST_MPL_ASSERT((FunctionReturningInt<int (AType::*)()>)); 21 BOOST_MPL_ASSERT((FunctionReturningInt<double (AnotherType::*)(int)>)); 22 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction)<AType (AnotherType::*)(int)>)); 23 BOOST_MPL_ASSERT((AnotherIntFunction<int (AnotherType::*)(AType)>)); 24 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction)<AType::AnIntType (AnotherType::*)(int,long,double)>)); 25 26 return 0; 27 28 } 29