mirror of
https://github.com/microsoft/GSL.git
synced 2025-02-21 08:52:53 -05:00
adding a test to verify that the additional ctad works
This commit is contained in:
parent
689abc2982
commit
6c405a1b7f
@ -1227,6 +1227,21 @@ TEST(span_test, from_array_constructor)
|
|||||||
EXPECT_FALSE((std::is_default_constructible<span<int, 42>>::value));
|
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)
|
TEST(span_test, front_back)
|
||||||
{
|
{
|
||||||
int arr[5] = {1,2,3,4,5};
|
int arr[5] = {1,2,3,4,5};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user