1
2// (C) Copyright Edward Diener 2013
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_mem_fun.hpp"
8#include <boost/mpl/assert.hpp>
9
10int main()
11 {
12
13 // You can always instantiate without compiler errors
14
15 BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(someFunctionMember)<double (AnotherType::*)(short,short,long,int) volatile> aVar1;
16
17 // Use const
18
19 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AConstFunction)<double (AType::*)(long,char) const>));
20 BOOST_MPL_ASSERT((StillTest<AType (AnotherType::*)(int) const>));
21 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AnotherConstFunction)<int (AnotherType::*)(AType *, short) const>));
22 BOOST_MPL_ASSERT((AskIfConst<void (AType::*)(float,double) const>));
23
24 // Use volatile
25
26 BOOST_MPL_ASSERT((AnVol<int (AnotherType::*)(AType *,short) volatile>));
27 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(AVolatileFunction)<double (AType::*)(long,char) volatile>));
28 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillVolatile)<bool (AnotherType::*)(int) volatile>));
29 BOOST_MPL_ASSERT((Volly<void (AType::*)(float,double) volatile>));
30
31 // Use const volatile
32
33 BOOST_MPL_ASSERT((CVAnother<int (AnotherType::*)(AType *,short) const volatile>));
34 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(StillCV)<short (AnotherType::*)(int) const volatile>));
35 BOOST_MPL_ASSERT((BOOST_TTI_HAS_MEMBER_FUNCTION_GEN(ConstVolFunction)<void (AType::*)(float,double) const volatile>));
36 BOOST_MPL_ASSERT((CVBoth<double (AType::*)(long,char) const volatile>));
37
38 return 0;
39
40 }
41

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