adding a test to verify that the additional ctad works

This commit is contained in:
Jordan Maples 2020-05-28 17:18:08 -07:00
parent 689abc2982
commit 6c405a1b7f

View File

@ -1227,6 +1227,21 @@ TEST(span_test, from_array_constructor)
EXPECT_FALSE((std::is_default_constructible<span<int, 42>>::value));
}
TEST(span_test, std_container_ctad)
{
#if (defined(__cpp_deduction_guides) && (__cpp_deduction_guides >= 201611L))
// this test is just to verify that these compile
{
std::vector v{1,2,3,4};
gsl::span sp{v};
}
{
std::string str{"foo"};
gsl::span sp{str};
}
#endif
}
TEST(span_test, front_back)
{
int arr[5] = {1,2,3,4,5};