##// END OF EJS Templates
Added cpp_utils header to host cpp tricks...
Added cpp_utils header to host cpp tricks Signed-off-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>

File last commit:

r38:8aaed85ac7f5
r38:8aaed85ac7f5
Show More
cpp_utils.h
21 lines | 464 B | text/x-c | CLexer
#ifndef CPP_UTILS_H
#define CPP_UTILS_H
#include <type_traits>
template< class... >
using void_t = void;
#define HAS_METHOD(method)\
template <class T, class=void>\
struct _has_##method : std::false_type{};\
\
template <class T>\
struct _has_##method<T, void_t<std::is_member_function_pointer<decltype(&T::method)>>>\
: std::true_type{};\
\
template< class T>\
static inline constexpr bool has_##method = _has_##method<T>::value;
#endif // CPP_UTILS_H