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/mpl/assert.hpp> |
9 | |
10 | int main() |
11 | { |
12 | |
13 | // You can always instantiate without compiler errors |
14 | |
15 | TheTIntFunction<AType,void,boost::mpl::vector<long,double> > aVar; |
16 | BOOST_TTI_HAS_FUNCTION_GEN(someFunctionMember)<AnotherType,double,boost::mpl::vector<short,short,long,int> > aVar2; |
17 | Pickedname<AnotherType,AType,boost::mpl::vector<long,long> > aVar3; |
18 | FunctionReturningInt<AType,int,boost::mpl::vector<>,boost::function_types::volatile_qualified > aVar4; |
19 | |
20 | // Compile time asserts |
21 | |
22 | BOOST_MPL_ASSERT((TheTIntFunction<AnotherType,AType,boost::mpl::vector<long,double> >)); |
23 | BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(VoidFunction)<AType,void>)); |
24 | BOOST_MPL_ASSERT((FunctionReturningInt<AType,int>)); |
25 | BOOST_MPL_ASSERT((FunctionReturningInt<AnotherType,double,boost::mpl::vector<int> >)); |
26 | BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(TSFunction)<AnotherType,AType::AStructType,boost::mpl::vector<AType::AnIntType,double> >)); |
27 | BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(aFunction)<AnotherType,AType,boost::mpl::vector<int> >)); |
28 | BOOST_MPL_ASSERT((AnotherIntFunction<AnotherType,int,boost::mpl::vector<AType> >)); |
29 | BOOST_MPL_ASSERT((HaveTheSIntFunction<AType,int,boost::mpl::vector<long,double> >)); |
30 | BOOST_MPL_ASSERT((BOOST_TTI_HAS_FUNCTION_GEN(sFunction)<AnotherType,AType::AnIntType,boost::mpl::vector<int,long,double> >)); |
31 | |
32 | return 0; |
33 | |
34 | } |
35 | |