Go to the documentation of this file. 46 #ifndef MIRA_HASNONMEMBER_H_ 47 #define MIRA_HASNONMEMBER_H_ 53 #define MIRA_NONMEMBER_FUNCTION0_DETECTOR_EX(Identifier, ReturnType, FunctionName) \ 54 template <typename = ReturnType> \ 55 struct MIRAHasNonMemberCheck##Identifier \ 57 typedef std::false_type type; \ 58 enum { value = false }; \ 62 struct MIRAHasNonMemberCheck##Identifier<decltype(FunctionName())> \ 64 typedef std::true_type type; \ 65 enum { value = true }; \ 68 #define MIRA_NONMEMBER_FUNCTION0_DETECTOR(ReturnType, FunctionName) \ 69 MIRA_NONMEMBER_FUNCTION0_DETECTOR_EX(FunctionName, ReturnType, FunctionName) 73 #define MIRA_NONMEMBER_FUNCTION1_DETECTOR_EX(Identifier, ReturnType, FunctionName) \ 74 template <typename P0, typename = ReturnType> \ 75 struct MIRAHasNonMemberCheck##Identifier \ 77 typedef std::false_type type; \ 78 enum { value = false }; \ 81 template <typename P0> \ 82 struct MIRAHasNonMemberCheck##Identifier<P0, \ 83 decltype(FunctionName(std::declval<P0>()))> \ 85 typedef std::true_type type; \ 86 enum { value = true }; \ 89 #define MIRA_NONMEMBER_FUNCTION1_DETECTOR(ReturnType, FunctionName) \ 90 MIRA_NONMEMBER_FUNCTION1_DETECTOR_EX(FunctionName, ReturnType, FunctionName) 94 #define MIRA_NONMEMBER_FUNCTION2_DETECTOR_EX(Identifier, ReturnType, FunctionName) \ 95 template <typename P0, typename P1, typename = ReturnType> \ 96 struct MIRAHasNonMemberCheck##Identifier \ 98 typedef std::false_type type; \ 99 enum { value = false }; \ 102 template <typename P0, typename P1> \ 103 struct MIRAHasNonMemberCheck##Identifier<P0, P1, \ 104 decltype(FunctionName(std::declval<P0>(), \ 105 std::declval<P1>()))> \ 107 typedef std::true_type type; \ 108 enum { value = true }; \ 111 #define MIRA_NONMEMBER_FUNCTION2_DETECTOR(ReturnType, FunctionName) \ 112 MIRA_NONMEMBER_FUNCTION2_DETECTOR_EX(FunctionName, ReturnType, FunctionName) 116 #define MIRA_NONMEMBER_FUNCTION3_DETECTOR_EX(Identifier, ReturnType, FunctionName) \ 117 template <typename P0, typename P1, typename P2, typename = ReturnType> \ 118 struct MIRAHasNonMemberCheck##Identifier \ 120 typedef std::false_type type; \ 121 enum { value = false }; \ 124 template <typename P0, typename P1, typename P2> \ 125 struct MIRAHasNonMemberCheck##Identifier<P0, P1, P2, \ 126 decltype(FunctionName(std::declval<P0>(), \ 127 std::declval<P1>(), \ 128 std::declval<P2>()))> \ 130 typedef std::true_type type; \ 131 enum { value = true }; \ 134 #define MIRA_NONMEMBER_FUNCTION3_DETECTOR(ReturnType, FunctionName) \ 135 MIRA_NONMEMBER_FUNCTION3_DETECTOR_EX(FunctionName, ReturnType, FunctionName) 150 #define MIRA_HAS_NONMEMBER_FUNCTION0(Identifier) \ 151 MIRAHasNonMemberCheck##Identifier<> 166 #define MIRA_HAS_NONMEMBER_FUNCTION1(Identifier, ParamType0) \ 167 MIRAHasNonMemberCheck##Identifier<ParamType0> 182 #define MIRA_HAS_NONMEMBER_FUNCTION2(Identifier, ParamType0, ParamType1) \ 183 MIRAHasNonMemberCheck##Identifier<ParamType0, ParamType1> 198 #define MIRA_HAS_NONMEMBER_FUNCTION3(Identifier, ParamType0, ParamType1, ParamType2) \ 199 MIRAHasNonMemberCheck##Identifier<ParamType0, ParamType1, ParamType2>