• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 //  (C) Copyright Edward Diener 2012,2013,2019
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 #if !defined(BOOST_TTI_DETAIL_FUNCTION_HPP)
8 #define BOOST_TTI_DETAIL_FUNCTION_HPP
9 
10 #include <boost/mpl/and.hpp>
11 #include <boost/mpl/eval_if.hpp>
12 #include <boost/mpl/or.hpp>
13 #include <boost/preprocessor/cat.hpp>
14 #include <boost/tti/detail/dmem_fun.hpp>
15 #include <boost/tti/detail/dstatic_mem_fun.hpp>
16 #include <boost/tti/detail/dtfunction.hpp>
17 #include <boost/tti/detail/denclosing_type.hpp>
18 #include <boost/tti/detail/dstatic_function_tags.hpp>
19 #include <boost/tti/gen/namespace_gen.hpp>
20 
21 #define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC_CALL(trait,name) \
22   BOOST_TTI_DETAIL_TRAIT_IMPL_HAS_STATIC_MEMBER_FUNCTION(trait,name) \
23   template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
24   struct BOOST_PP_CAT(trait,_detail_hfsc) : \
25     BOOST_PP_CAT(trait,_detail_ihsmf) \
26         < \
27         BOOST_TTI_DETAIL_TP_T, \
28         typename BOOST_TTI_NAMESPACE::detail::tfunction_seq<BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>::type \
29         > \
30     { \
31     }; \
32 /**/
33 
34 #define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC(trait,name) \
35   BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC_CALL(trait,name) \
36   template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
37   struct BOOST_PP_CAT(trait,_detail_hfs) : \
38     boost::mpl::eval_if \
39         < \
40         boost::mpl::and_ \
41             < \
42             BOOST_TTI_NAMESPACE::detail::enclosing_type<BOOST_TTI_DETAIL_TP_T>, \
43             BOOST_TTI_NAMESPACE::detail::static_function_tag<BOOST_TTI_DETAIL_TP_TAG> \
44             >, \
45         BOOST_PP_CAT(trait,_detail_hfsc)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
46         boost::mpl::false_ \
47         > \
48     { \
49     }; \
50 /**/
51 
52 #define BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION(trait,name) \
53   BOOST_TTI_DETAIL_TRAIT_HAS_CALL_TYPES_MEMBER_FUNCTION(trait,name) \
54   BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION_STATIC(trait,name) \
55   template<class BOOST_TTI_DETAIL_TP_T,class BOOST_TTI_DETAIL_TP_R,class BOOST_TTI_DETAIL_TP_FS,class BOOST_TTI_DETAIL_TP_TAG> \
56   struct BOOST_PP_CAT(trait,_detail_hf) : \
57     boost::mpl::or_ \
58         < \
59         BOOST_PP_CAT(trait,_detail_hmf_call_types)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG>, \
60         BOOST_PP_CAT(trait,_detail_hfs)<BOOST_TTI_DETAIL_TP_T,BOOST_TTI_DETAIL_TP_R,BOOST_TTI_DETAIL_TP_FS,BOOST_TTI_DETAIL_TP_TAG> \
61         > \
62     { \
63     }; \
64 /**/
65 
66 #endif // BOOST_TTI_DETAIL_FUNCTION_HPP
67