Skip to content

Commit

Permalink
Merge pull request #1085 from hiradyazdan/cpp_master
Browse files Browse the repository at this point in the history
Fix to avoid common function name's (`has_as::check`) ambiguity/conflict with other libraries' macros
  • Loading branch information
redboltz authored Aug 14, 2023
2 parents 8c602e8 + e7f7b51 commit b2f056c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions include/msgpack/v1/object_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ template <typename T>
struct has_as {
private:
template <typename U>
static auto check(U*) ->
static auto check_(U*) ->
// Check v1 specialization
typename std::is_same<
decltype(adaptor::as<U>()(std::declval<msgpack::object>())),
T
>::type;
template <typename...>
static std::false_type check(...);
static std::false_type check_(...);
public:
using type = decltype(check<T>(MSGPACK_NULLPTR));
using type = decltype(check_<T>(MSGPACK_NULLPTR));
static constexpr bool value = type::value;
};

Expand Down
6 changes: 3 additions & 3 deletions include/msgpack/v2/object_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ template <typename T>
struct has_as {
private:
template <typename U>
static auto check(U*) ->
static auto check_(U*) ->
typename std::enable_if<
// check v2 specialization
std::is_same<
Expand All @@ -92,9 +92,9 @@ struct has_as {
std::true_type
>::type;
template <typename...>
static std::false_type check(...);
static std::false_type check_(...);
public:
using type = decltype(check<T>(MSGPACK_NULLPTR));
using type = decltype(check_<T>(MSGPACK_NULLPTR));
static constexpr bool value = type::value;
};

Expand Down
6 changes: 3 additions & 3 deletions include/msgpack/v3/object_fwd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ template <typename T>
struct has_as {
private:
template <typename U>
static auto check(U*) ->
static auto check_(U*) ->
typename std::enable_if<
// check v3 specialization
std::is_same<
Expand All @@ -52,9 +52,9 @@ struct has_as {
std::true_type
>::type;
template <typename...>
static std::false_type check(...);
static std::false_type check_(...);
public:
using type = decltype(check<T>(MSGPACK_NULLPTR));
using type = decltype(check_<T>(MSGPACK_NULLPTR));
static constexpr bool value = type::value;
};

Expand Down

0 comments on commit b2f056c

Please sign in to comment.