From 6c405a1b7f49da97124b79b2d667c9c75b271701 Mon Sep 17 00:00:00 2001 From: Jordan Maples Date: Thu, 28 May 2020 17:18:08 -0700 Subject: adding a test to verify that the additional ctad works --- tests/span_tests.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') 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>::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}; -- cgit v1.2.3