test_has_mem_fun.cpp 1.4 KB

123456789101112131415161718192021222324252627282930
  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)<AType,void>::value));
  10. BOOST_TEST((FunctionReturningInt<AType,int>::value));
  11. BOOST_TEST((FunctionReturningInt<AnotherType,double,boost::mpl::vector<int> >::value));
  12. BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(aFunction)<AnotherType,AType,boost::mpl::vector<int> >::value));
  13. BOOST_TEST((AnotherIntFunction<AnotherType,int,boost::mpl::vector<AType> >::value));
  14. BOOST_TEST((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction)<AnotherType,AType::AnIntType,boost::mpl::vector<int,long,double> >::value));
  15. BOOST_TEST((!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember)<AnotherType,AType,boost::mpl::vector<long,int> >::value));
  16. // Test enclosing class as non-class type
  17. BOOST_TEST((!AnotherIntFunction<short,int,boost::mpl::vector<AType> >::value));
  18. BOOST_TEST((!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(VoidFunction)<unsigned,void>::value));
  19. BOOST_TEST((!BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(sFunction)<AnotherType *,AType::AnIntType,boost::mpl::vector<int,long,double> >::value));
  20. BOOST_TEST((!FunctionReturningInt<float ***,int>::value));
  21. return boost::report_errors();
  22. }