#include <Eigen/Core>
#include <type_traits>
Go to the source code of this file.
◆ MAKE_GETTER_DETECTOR
#define MAKE_GETTER_DETECTOR |
( |
|
GETTER | ) |
|
Value: namespace impl \
{ \
template<typename T> \
struct GETTER##_getter_traits \
{ \
template<typename U> \
static constexpr std::true_type test_has(
std::void_t<decltype(std::declval<U>().GETTER())> * =
nullptr); \
template<typename U> \
static constexpr std::false_type test_has(...); \
static constexpr bool has = decltype(test_has<T>(0))::value; \
template<typename U> \
static
auto test(
std::void_t<decltype(std::declval<const U>().GETTER())> * =
nullptr) \
-> decltype(std::declval<const U>().GETTER()); \
template<typename U> \
static void test(...); \
using type = decltype(test<T>(0)); \
}; \
} \
template<typename T> \
inline constexpr bool has_##GETTER##_getter_v = impl::GETTER##_getter_traits<T>::has; \
template<typename T> \
using GETTER##_return_t = typename impl::GETTER##_getter_traits<T>::type
◆ MAKE_SETTER_DETECTOR
#define MAKE_SETTER_DETECTOR |
( |
|
SETTER | ) |
|
Value: namespace impl \
{ \
template<typename T> \
struct has_##SETTER##_setter \
{ \
template<typename U> \
static constexpr std::true_type test( \
std::void_t<decltype(std::declval<U>().SETTER(std::declval<Eigen::VectorXd>()))> * =
nullptr); \
template<typename U> \
static constexpr std::false_type test(...); \
static constexpr bool value = decltype(test<T>(0))::value; \
}; \
} \
template<typename T> \
inline constexpr bool has_##SETTER##_setter_v = impl::has_##SETTER##_setter<T>::value