span support for initializer_list

This commit is contained in:
Glen Fernandes
2023-01-28 09:31:12 -05:00
parent 90231ed7e0
commit 7736b0b8ce
4 changed files with 69 additions and 19 deletions

View File

@@ -1,5 +1,5 @@
/*
Copyright 2019 Glen Joseph Fernandes
Copyright 2019-2023 Glen Joseph Fernandes
(glenjofe@gmail.com)
Distributed under the Boost Software License, Version 1.0.
@@ -140,6 +140,14 @@ void test_range()
range<derived>&>));
}
void test_initializer_list()
{
BOOST_TEST_TRAIT_TRUE((std::is_constructible<boost::span<const int>,
std::initializer_list<int> >));
BOOST_TEST_TRAIT_FALSE((std::is_constructible<boost::span<int>,
std::initializer_list<int> >));
}
void test_span()
{
BOOST_TEST_TRAIT_TRUE((std::is_constructible<boost::span<const int>,
@@ -187,6 +195,7 @@ int main()
test_std_array();
test_const_std_array();
test_range();
test_initializer_list();
test_span();
test_copy();
test_assign();