1
2// (C) Copyright Edward Diener 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_fun.hpp"
8#include <boost/detail/lightweight_test.hpp>
9
10int main()
11 {
12
13 BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(VoidFunction)<AType,void>::value));
14 BOOST_TEST((HaveTheSIntFunction<AType,int,boost::mpl::vector<long,double> >::value));
15 BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(TSFunction)<AnotherType,AType::AStructType,boost::mpl::vector<AType::AnIntType,double> >::value));
16 BOOST_TEST((FunctionReturningInt<AType,int>::value));
17 BOOST_TEST((!Pickedname<AnotherType,void>::value));
18 BOOST_TEST((!TheTIntFunction<AType,AType,boost::mpl::vector<long,double> >::value));
19 BOOST_TEST((FunctionReturningInt<AnotherType,double,boost::mpl::vector<int> >::value));
20 BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(aFunction)<AnotherType,AType,boost::mpl::vector<int> >::value));
21 BOOST_TEST((AnotherIntFunction<AnotherType,int,boost::mpl::vector<AType> >::value));
22 BOOST_TEST((BOOST_TTI_HAS_FUNCTION_GEN(sFunction)<AnotherType,AType::AnIntType,boost::mpl::vector<int,long,double> >::value));
23 BOOST_TEST((!BOOST_TTI_HAS_FUNCTION_GEN(someFunctionMember)<AnotherType,AType,boost::mpl::vector<long,int> >::value));
24 BOOST_TEST((TheTIntFunction<AnotherType,AType,boost::mpl::vector<long,double> >::value));
25
26 // Passing non-class enclosing type will return false
27
28 BOOST_TEST((!HaveTheSIntFunction<long,int,boost::mpl::vector<long,double> >::value));
29 BOOST_TEST((!BOOST_TTI_HAS_FUNCTION_GEN(TSFunction)<AnotherType **,AType::AStructType,boost::mpl::vector<AType::AnIntType,double> >::value));
30
31 return boost::report_errors();
32
33 }
34

source code of boost/libs/tti/test/test_has_fun.cpp