test_has_member.cpp 989 B

1234567891011121314151617181920212223
  1. // (C) Copyright Edward Diener 2011
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. #include "test_has_mem_fun.hpp"
  6. #include <boost/detail/lightweight_test.hpp>
  7. int main()
  8. {
  9. BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction)<void (AType::*)()>::value));
  10. BOOST_TEST(FunctionReturningInt<int (AType::*)()>::value);
  11. BOOST_TEST(FunctionReturningInt<double (AnotherType::*)(int)>::value);
  12. BOOST_TEST(BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction)<AType (AnotherType::*)(int)>::value);
  13. BOOST_TEST(AnotherIntFunction<int (AnotherType::*)(AType)>::value);
  14. BOOST_TEST(BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction)<AType::AnIntType (AnotherType::*)(int,long,double)>::value);
  15. BOOST_TEST(!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember)<AType (AnotherType::*)(long,int)>::value);
  16. return boost::report_errors();
  17. }