comparison DEPENDENCIES/generic/include/boost/tti/has_function.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1
2 // (C) Copyright Edward Diener 2012,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 #if !defined(BOOST_TTI_HAS_FUNCTION_HPP)
8 #define BOOST_TTI_HAS_FUNCTION_HPP
9
10 #include <boost/function_types/property_tags.hpp>
11 #include <boost/mpl/vector.hpp>
12 #include <boost/preprocessor/cat.hpp>
13 #include <boost/tti/detail/dfunction.hpp>
14 #include <boost/tti/gen/has_function_gen.hpp>
15
16 /*
17
18 The succeeding comments in this file are in doxygen format.
19
20 */
21
22 /** \file
23 */
24
25 /// Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists.
26 /**
27
28 trait = the name of the metafunction within the tti namespace.
29
30 name = the name of the inner member.
31
32 generates a metafunction called "trait" where 'trait' is the macro parameter.
33
34 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG>
35 struct trait
36 {
37 static const value = unspecified;
38 typedef mpl::bool_<true-or-false> type;
39 };
40
41 The metafunction types and return:
42
43 BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
44
45 BOOST_TTI_TP_R = the return type of the function
46
47 BOOST_TTI_TP_FS = (optional) the parameters of the function as a boost::mpl forward sequence
48 if function parameters are not empty.
49
50 BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function
51 if the need for a tag exists.
52
53 returns = 'value' is true if the 'name' exists,
54 with the appropriate static member function type,
55 otherwise 'value' is false.
56
57 */
58 #define BOOST_TTI_TRAIT_HAS_FUNCTION(trait,name) \
59 BOOST_TTI_DETAIL_TRAIT_HAS_FUNCTION(trait,name) \
60 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS = boost::mpl::vector<>,class BOOST_TTI_TP_TAG = boost::function_types::null_tag> \
61 struct trait : \
62 BOOST_PP_CAT(trait,_detail_hf)<BOOST_TTI_TP_T,BOOST_TTI_TP_R,BOOST_TTI_TP_FS,BOOST_TTI_TP_TAG> \
63 { \
64 }; \
65 /**/
66
67 /// Expands to a metafunction which tests whether a member function or a static member function with a particular name and signature exists.
68 /**
69
70 name = the name of the inner member.
71
72 generates a metafunction called "has_function_name" where 'name' is the macro parameter.
73
74 template<class BOOST_TTI_TP_T,class BOOST_TTI_TP_R,class BOOST_TTI_TP_FS,class BOOST_TTI_TP_TAG>
75 struct trait
76 {
77 static const value = unspecified;
78 typedef mpl::bool_<true-or-false> type;
79 };
80
81 The metafunction types and return:
82
83 BOOST_TTI_TP_T = the enclosing type in which to look for our 'name'.
84
85 BOOST_TTI_TP_R = the return type of the function
86
87 BOOST_TTI_TP_FS = (optional) the parameters of the function as a boost::mpl forward sequence
88 if function parameters are not empty.
89
90 BOOST_TTI_TP_TAG = (optional) a boost::function_types tag to apply to the function
91 if the need for a tag exists.
92
93 returns = 'value' is true if the 'name' exists,
94 with the appropriate function type,
95 otherwise 'value' is false.
96
97 */
98 #define BOOST_TTI_HAS_FUNCTION(name) \
99 BOOST_TTI_TRAIT_HAS_FUNCTION \
100 ( \
101 BOOST_TTI_HAS_FUNCTION_GEN(name), \
102 name \
103 ) \
104 /**/
105
106 #endif // BOOST_TTI_HAS_FUNCTION_HPP