test commit to get extra eyes on the problem

This commit is contained in:
Jordan Maples
2020-03-17 13:53:13 -07:00
parent d90fefea6d
commit 1dd1320c8b
2 changed files with 34 additions and 0 deletions
+16
View File
@@ -46,6 +46,22 @@ TEST(span_compatibility_tests, assertion_tests)
{
int arr[3]{10, 20, 30};
std::array<int, 3> stl{{100, 200, 300}};
std::array<int*, 3> stl_nullptr{{nullptr,nullptr,nullptr}};
{
gsl::span<const int* const> sp_const_nullptr_1{stl_nullptr};
EXPECT_TRUE(sp_const_nullptr_1.data() == stl_nullptr.data());
EXPECT_TRUE(sp_const_nullptr_1.size() == 3);
#if __cplusplus >= 201703l
span<const int* const> sp_const_nullptr_2{std::as_const(stl_nullptr)};
EXPECT_TRUE(sp_const_nullptr_2.data() == stl_nullptr.data());
EXPECT_TRUE(sp_const_nullptr_2.size() == 3);
static_assert(std::is_same<decltype(span{stl_nullptr}), span<int*, 3>);
static_assert(std::is_same<decltype(span{std::as_const(stl_nullptr)}), span<int* const, 3>);
#endif
}
{
gsl::span<int> sp_dyn;