diff options
author | Jordan Maples <jomaples@microsoft.com> | 2020-05-29 03:18:08 +0300 |
---|---|---|
committer | Jordan Maples <jomaples@microsoft.com> | 2020-05-29 03:18:08 +0300 |
commit | 6c405a1b7f49da97124b79b2d667c9c75b271701 (patch) | |
tree | 89312bdf808450d26c8e8c3d5b5b34c942f4f19d /tests | |
parent | 689abc29828b6ad0aaf4fd555e5d979e42186fca (diff) |
adding a test to verify that the additional ctad works
Diffstat (limited to 'tests')
-rw-r--r-- | tests/span_tests.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/span_tests.cpp b/tests/span_tests.cpp index ce881ba..f53518b 100644 --- a/tests/span_tests.cpp +++ b/tests/span_tests.cpp @@ -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}; |