diff --git a/CMakeLists.txt b/CMakeLists.txt index 60af5e7..6545cef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,7 @@ FILE (GLOB_RECURSE core_SRCS ./include/Common/deprecate.h ./include/Common/containers.h ./include/Common/debug.h + ./include/Common/cpp_utils.h ./include/Plugin/IPlugin.h ./include/Data/ArrayDataIterator.h ./include/Data/VariableRequest.h diff --git a/include/Common/cpp_utils.h b/include/Common/cpp_utils.h new file mode 100644 index 0000000..5c4aa22 --- /dev/null +++ b/include/Common/cpp_utils.h @@ -0,0 +1,21 @@ +#ifndef CPP_UTILS_H +#define CPP_UTILS_H + +#include + +template< class... > +using void_t = void; + +#define HAS_METHOD(method)\ +template \ +struct _has_##method : std::false_type{};\ +\ +template \ +struct _has_##method>>\ + : std::true_type{};\ +\ +template< class T>\ +static inline constexpr bool has_##method = _has_##method::value; + + +#endif // CPP_UTILS_H