mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Merge pull request #3 from JordanMaples/dev/jomaples/lwg3255
adding additional filtering
This commit is contained in:
commit
c5dd0e6d40
@ -42,6 +42,7 @@ static_assert(std::is_convertible<Derived*, Base*>::value, "std::is_convertible<
|
|||||||
static_assert(!std::is_convertible<Derived (*)[], Base (*)[]>::value,
|
static_assert(!std::is_convertible<Derived (*)[], Base (*)[]>::value,
|
||||||
"!std::is_convertible<Derived(*)[], Base(*)[]>");
|
"!std::is_convertible<Derived(*)[], Base(*)[]>");
|
||||||
|
|
||||||
|
#if (defined(_MSC_VER)) || (defined(__GNUC__) && __GNUC__ > 7) || (defined(__clang__) && __clang_major__ > 6)
|
||||||
template <class = void>
|
template <class = void>
|
||||||
void ArrayConvertibilityCheck()
|
void ArrayConvertibilityCheck()
|
||||||
{
|
{
|
||||||
@ -57,15 +58,19 @@ void ArrayConvertibilityCheck()
|
|||||||
EXPECT_TRUE(sp_const_nullptr_2.data() == stl_nullptr.data());
|
EXPECT_TRUE(sp_const_nullptr_2.data() == stl_nullptr.data());
|
||||||
EXPECT_TRUE(sp_const_nullptr_2.size() == 3);
|
EXPECT_TRUE(sp_const_nullptr_2.size() == 3);
|
||||||
|
|
||||||
static_assert(std::is_same<decltype(span{stl_nullptr}), span<int*, 3>>::value,
|
static_assert(std::is_same<decltype(span{stl_nullptr}), span<int*, 3>>::value,
|
||||||
"std::is_same< decltype(span{stl_nullptr}), span<int*, 3>>::value");
|
"std::is_same< decltype(span{stl_nullptr}), span<int*, 3>>::value");
|
||||||
static_assert(
|
static_assert(
|
||||||
std::is_same<decltype(span{std::as_const(stl_nullptr)}), span<int* const, 3>>::value,
|
std::is_same<decltype(span{std::as_const(stl_nullptr)}), span<int* const, 3>>::value,
|
||||||
"std::is_same< decltype(span{std::as_const(stl_nullptr)}), span<int* const, "
|
"std::is_same< decltype(span{std::as_const(stl_nullptr)}), span<int* const, "
|
||||||
"3>>::value");
|
"3>>::value");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
template <class = void>
|
||||||
|
void ArrayConvertibilityCheck(){}
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST(span_compatibility_tests, assertion_tests)
|
TEST(span_compatibility_tests, assertion_tests)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user