Go to the documentation of this file.
25 #ifndef __MLPACK_CORE_SFINAE_UTILITY
26 #define __MLPACK_CORE_SFINAE_UTILITY
28 #include <boost/utility/enable_if.hpp>
29 #include <boost/type_traits.hpp>
50 #define HAS_MEM_FUNC(FUNC, NAME) \
51 template<typename T, typename sig> \
53 typedef char yes[1]; \
54 typedef char no [2]; \
55 template<typename U, U> struct type_check; \
56 template<typename _1> static yes &chk(type_check<sig, &_1::FUNC> *); \
57 template<typename > static no &chk(...); \
58 static bool const value = sizeof(chk<T>(0)) == sizeof(yes); \