test_has_fun_compile.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. // (C) Copyright Edward Diener 2012
  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_fun.hpp"
  6. #include <boost/mpl/assert.hpp>
  7. int main()
  8. {
  9. // You can always instantiate without compiler errors
  10. TheTIntFunction<AType,void,boost::mpl::vector<long,double> > aVar;
  11. BOOST_TTI_HAS_FUNCTION_GEN(someFunctionMember)<AnotherType,double,boost::mpl::vector<short,short,long,int> > aVar2;
  12. Pickedname<AnotherType,AType,boost::mpl::vector<long,long> > aVar3;
  13. // Compile time asserts
  14. BOOST_MPL_ASSERT((TheTIntFunction<AnotherType,AType,boost::mpl::vector<long,double> >));
  15. BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(VoidFunction)<AType,void>));
  16. BOOST_MPL_ASSERT((FunctionReturningInt<AType,int>));
  17. BOOST_MPL_ASSERT((FunctionReturningInt<AnotherType,double,boost::mpl::vector<int> >));
  18. BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(TSFunction)<AnotherType,AType::AStructType,boost::mpl::vector<AType::AnIntType,double> >));
  19. BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(aFunction)<AnotherType,AType,boost::mpl::vector<int> >));
  20. BOOST_MPL_ASSERT((AnotherIntFunction<AnotherType,int,boost::mpl::vector<AType> >));
  21. BOOST_MPL_ASSERT((HaveTheSIntFunction<AType,int,boost::mpl::vector<long,double> >));
  22. BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(sFunction)<AnotherType,AType::AnIntType,boost::mpl::vector<int,long,double> >));
  23. return 0;
  24. }