Extend docs and tests for span ctor (#1096)

This commit is contained in:
Werner Henze
2023-02-22 00:46:40 +01:00
committed by GitHub
parent 9851b94d7e
commit 7a297d4283
2 changed files with 10 additions and 0 deletions

View File

@@ -681,6 +681,13 @@ TEST(span_test, from_convertible_span_constructor)
static_cast<void>(avcd);
}
{
std::array<DerivedClass, 2> arr{};
span<DerivedClass> avd{arr};
using T = span<const DerivedClass, 1>;
EXPECT_DEATH(T{avd}, expected);
}
{
std::array<DerivedClass, 1> arr{};
span<DerivedClass> avd{arr};