10#ifndef ADOBE_TYPE_INSPECTION_HPP
11#define ADOBE_TYPE_INSPECTION_HPP
40#define ADOBE_HAS_TYPE_IMPL(TypeInQuestion) \
41 template <typename C##TypeInQuestion> \
42 struct has_type##TypeInQuestion { \
43 template <typename T##TypeInQuestion> \
44 static adobe::detail::yes_struct SFINAE(typename T##TypeInQuestion::TypeInQuestion*); \
46 static adobe::detail::no_struct SFINAE(...); \
47 static const bool value = \
48 sizeof(SFINAE<C##TypeInQuestion>(0)) == sizeof(adobe::detail::yes_struct); \
70#define ADOBE_HAS_TYPE(C, TypeInQuestion) has_type##TypeInQuestion<C>::value
86template <
typename T,
typename Default>
88 template <
bool condition,
typename IFtype,
typename ELSEtype>
90 typedef typename IFtype::type
type;
92 template <
typename IFtype,
typename ELSEtype>
119#define ADOBE_HAS_MEMBER_IMPL(Member) \
120 template <class Class> \
121 struct has_member##Member { \
122 __if_exists(Class::Member) { static const bool value = true; } \
123 __if_not_exists(Class::Member) { static const bool value = false; } \
129struct member_test_helper {};
132#define ADOBE_HAS_MEMBER_IMPL(MemberInQuestion) \
133 template <class Class> \
134 struct has_member##MemberInQuestion { \
135 template <class T##MemberInQuestion> \
136 static adobe::detail::yes_struct SFINAE( \
137 adobe::detail::member_test_helper<sizeof(&T##MemberInQuestion::MemberInQuestion)>*); \
139 static adobe::detail::no_struct SFINAE(...); \
140 static const bool value = sizeof(SFINAE<Class>(0)) == sizeof(adobe::detail::yes_struct); \
163#define ADOBE_HAS_MEMBER(C, MemberInQuestion) has_member##MemberInQuestion<C>::value
181#define ADOBE_HAS_TEMPLATE1_IMPL(TemplateInQuestion) \
182 template <typename C##TemplateInQuestion> \
183 struct has_template1##TemplateInQuestion { \
184 template <typename T##TemplateInQuestion> \
185 static adobe::detail::yes_struct \
186 SFINAE(typename T##TemplateInQuestion::template TemplateInQuestion<int>*); \
187 template <typename> \
188 static adobe::detail::no_struct SFINAE(...); \
189 static const bool value = \
190 sizeof(SFINAE<C##TemplateInQuestion>(0)) == sizeof(adobe::detail::yes_struct); \
219#define ADOBE_HAS_TEMPLATE1(C, TemplateInQuestion) has_template1##TemplateInQuestion<C>::value
225#define ADOBE_HAS_TEMPLATE2_IMPL(TemplateInQuestion) \
226 template <typename C##TemplateInQuestion> \
227 struct has_template2##TemplateInQuestion { \
228 template <typename T##TemplateInQuestion> \
229 static adobe::detail::yes_struct \
230 SFINAE(typename T##TemplateInQuestion::template TemplateInQuestion<int, int>*); \
231 template <typename> \
232 static adobe::detail::no_struct SFINAE(...); \
233 static const bool value = \
234 sizeof(SFINAE<C##TemplateInQuestion>(0)) == sizeof(adobe::detail::yes_struct); \
237#define ADOBE_HAS_TEMPLATE2(C, TemplateInQuestion) has_template2##TemplateInQuestion<C>::value
239#define ADOBE_HAS_TEMPLATE3_IMPL(TemplateInQuestion) \
240 template <typename C##TemplateInQuestion> \
241 struct has_template3##TemplateInQuestion { \
242 template <typename T##TemplateInQuestion> \
243 static adobe::detail::yes_struct \
244 SFINAE(typename T##TemplateInQuestion::template TemplateInQuestion<int, int, int>*); \
245 template <typename> \
246 static adobe::detail::no_struct SFINAE(...); \
247 static const bool value = \
248 sizeof(SFINAE<C##TemplateInQuestion>(0)) == sizeof(adobe::detail::yes_struct); \
251#define ADOBE_HAS_TEMPLATE3(C, TemplateInQuestion) has_template3##TemplateInQuestion<C>::value
#define ADOBE_HAS_TYPE(C, TypeInQuestion)
returns true iff C has an internal type named 'TypeInQuestion'. ie returns true iff C::TypeInQuestion...
is T::type a valid type (or a compile error?)
ADOBE_HAS_TYPE_IMPL(type)
if_has_type< has_type_type< T >::value, T, Default >::type type