modified function name 'has_as::check' to avoid ambiguity/conflicts with other libraries/engines's macro definitions (e.g. UE)

This commit is contained in:
hiradyazdan 2023-08-13 18:32:33 +01:00
parent 8c602e8579
commit e7f7b51005
3 changed files with 9 additions and 9 deletions

View File

@ -53,16 +53,16 @@ template <typename T>
struct has_as { struct has_as {
private: private:
template <typename U> template <typename U>
static auto check(U*) -> static auto check_(U*) ->
// Check v1 specialization // Check v1 specialization
typename std::is_same< typename std::is_same<
decltype(adaptor::as<U>()(std::declval<msgpack::object>())), decltype(adaptor::as<U>()(std::declval<msgpack::object>())),
T T
>::type; >::type;
template <typename...> template <typename...>
static std::false_type check(...); static std::false_type check_(...);
public: public:
using type = decltype(check<T>(MSGPACK_NULLPTR)); using type = decltype(check_<T>(MSGPACK_NULLPTR));
static constexpr bool value = type::value; static constexpr bool value = type::value;
}; };

View File

@ -79,7 +79,7 @@ template <typename T>
struct has_as { struct has_as {
private: private:
template <typename U> template <typename U>
static auto check(U*) -> static auto check_(U*) ->
typename std::enable_if< typename std::enable_if<
// check v2 specialization // check v2 specialization
std::is_same< std::is_same<
@ -92,9 +92,9 @@ private:
std::true_type std::true_type
>::type; >::type;
template <typename...> template <typename...>
static std::false_type check(...); static std::false_type check_(...);
public: public:
using type = decltype(check<T>(MSGPACK_NULLPTR)); using type = decltype(check_<T>(MSGPACK_NULLPTR));
static constexpr bool value = type::value; static constexpr bool value = type::value;
}; };

View File

@ -36,7 +36,7 @@ template <typename T>
struct has_as { struct has_as {
private: private:
template <typename U> template <typename U>
static auto check(U*) -> static auto check_(U*) ->
typename std::enable_if< typename std::enable_if<
// check v3 specialization // check v3 specialization
std::is_same< std::is_same<
@ -52,9 +52,9 @@ private:
std::true_type std::true_type
>::type; >::type;
template <typename...> template <typename...>
static std::false_type check(...); static std::false_type check_(...);
public: public:
using type = decltype(check<T>(MSGPACK_NULLPTR)); using type = decltype(check_<T>(MSGPACK_NULLPTR));
static constexpr bool value = type::value; static constexpr bool value = type::value;
}; };