@@ -141,6 +141,22 @@ TEST_CASE("span is constructible from std::array (non const data)", "[span]") {
141141 STATIC_REQUIRE (std::size (s) == 4 );
142142}
143143
144+ TEST_CASE (" dynamic span is constructible from std::array (const data)" ,
145+ " [span]" ) {
146+ constexpr static auto a = std::array{1 , 2 , 3 , 4 };
147+ auto s = [](stdx::span<int const > x) { return x; }(a);
148+ CHECK (std::data (s) == std::data (a));
149+ CHECK (std::size (s) == std::size (a));
150+ }
151+
152+ TEST_CASE (" dynamic span is constructible from std::array (non const data)" ,
153+ " [span]" ) {
154+ auto a = std::array{1 , 2 , 3 , 4 };
155+ auto s = [](stdx::span<int > x) { return x; }(a);
156+ CHECK (std::data (s) == std::data (a));
157+ CHECK (std::size (s) == std::size (a));
158+ }
159+
144160TEST_CASE (" span is constructible from C-style array (const data)" , " [span]" ) {
145161 constexpr static int a[] = {1 , 2 , 3 , 4 };
146162 constexpr auto s = stdx::span{a};
@@ -159,6 +175,22 @@ TEST_CASE("span is constructible from C-style array (non const data)",
159175 CHECK (std::size (s) == std::size (a));
160176}
161177
178+ TEST_CASE (" dynamic span is constructible from C-style array (const data)" ,
179+ " [span]" ) {
180+ constexpr static int a[] = {1 , 2 , 3 , 4 };
181+ auto s = [](stdx::span<int const > x) { return x; }(a);
182+ CHECK (std::data (s) == std::data (a));
183+ CHECK (std::size (s) == std::size (a));
184+ }
185+
186+ TEST_CASE (" dynamic span is constructible from C-style array (non const data)" ,
187+ " [span]" ) {
188+ int a[] = {1 , 2 , 3 , 4 };
189+ auto s = [](stdx::span<int > x) { return x; }(a);
190+ CHECK (std::data (s) == std::data (a));
191+ CHECK (std::size (s) == std::size (a));
192+ }
193+
162194TEST_CASE (" dynamic span is implicitly constructible from range (const data)" ,
163195 " [span]" ) {
164196 std::vector const v{1 , 2 , 3 , 4 };
0 commit comments