Skip to content

Commit

Permalink
msvc checks ambiguous void_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Werner Henze committed Dec 23, 2024
1 parent fcdb1e5 commit aee268c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/span_compatibility_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,9 @@ static_assert(std::is_convertible<std::array<int, 3>&, gsl::span<const int>>::va
static_assert(std::is_convertible<const std::array<int, 3>&, gsl::span<const int>>::value,
"std::is_convertible<const std::array<int, 3>&, gsl::span<const int>>");

#if __cplusplus < 201703l
#if __cplusplus >= 201703l
using std::void_t;
#else // __cplusplus >= 201703l
template <class...>
using void_t = void;
#endif // __cplusplus < 201703l
Expand All @@ -1014,7 +1016,7 @@ static constexpr bool AsWritableBytesCompilesFor = false;

template <typename U>
static constexpr bool
AsWritableBytesCompilesFor<U, void_t<decltype(as_writable_bytes(declval<U>()))>> = true;
AsWritableBytesCompilesFor<U, ::void_t<decltype(as_writable_bytes(declval<U>()))>> = true;

static_assert(AsWritableBytesCompilesFor<gsl::span<int>>,
"AsWritableBytesCompilesFor<gsl::span<int>>");
Expand Down

0 comments on commit aee268c

Please sign in to comment.