Skip to content

Commit aee268c

Browse files
author
Werner Henze
committed
msvc checks ambiguous void_t
1 parent fcdb1e5 commit aee268c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/span_compatibility_tests.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,9 @@ static_assert(std::is_convertible<std::array<int, 3>&, gsl::span<const int>>::va
10041004
static_assert(std::is_convertible<const std::array<int, 3>&, gsl::span<const int>>::value,
10051005
"std::is_convertible<const std::array<int, 3>&, gsl::span<const int>>");
10061006

1007-
#if __cplusplus < 201703l
1007+
#if __cplusplus >= 201703l
1008+
using std::void_t;
1009+
#else // __cplusplus >= 201703l
10081010
template <class...>
10091011
using void_t = void;
10101012
#endif // __cplusplus < 201703l
@@ -1014,7 +1016,7 @@ static constexpr bool AsWritableBytesCompilesFor = false;
10141016

10151017
template <typename U>
10161018
static constexpr bool
1017-
AsWritableBytesCompilesFor<U, void_t<decltype(as_writable_bytes(declval<U>()))>> = true;
1019+
AsWritableBytesCompilesFor<U, ::void_t<decltype(as_writable_bytes(declval<U>()))>> = true;
10181020

10191021
static_assert(AsWritableBytesCompilesFor<gsl::span<int>>,
10201022
"AsWritableBytesCompilesFor<gsl::span<int>>");

0 commit comments

Comments
 (0)