mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-20 11:25:25 +02:00
Add additional overload for allocate_shared and make_shared array forms that take initializer list of T for the array types T[M][N]
[SVN r81341]
This commit is contained in:
@@ -26,6 +26,13 @@ int main() {
|
||||
BOOST_TEST(a1[1][0] == 2);
|
||||
BOOST_TEST(a1[1][1] == 3);
|
||||
}
|
||||
{
|
||||
boost::shared_ptr<int[2][2]> a1 = boost::make_shared<int[2][2]>({ 0, 1 });
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
BOOST_TEST(a1[0][1] == 1);
|
||||
BOOST_TEST(a1[1][0] == 0);
|
||||
BOOST_TEST(a1[1][1] == 1);
|
||||
}
|
||||
{
|
||||
boost::shared_ptr<int[][2]> a1 = boost::make_shared<int[][2]>(2, {0, 1});
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
@@ -40,6 +47,13 @@ int main() {
|
||||
BOOST_TEST(a1[1][1][0] == 2);
|
||||
BOOST_TEST(a1[1][1][1] == 3);
|
||||
}
|
||||
{
|
||||
boost::shared_ptr<int[2][2][2]> a1 = boost::make_shared<int[2][2][2]>({ {0, 1}, {2, 3} });
|
||||
BOOST_TEST(a1[0][0][0] == 0);
|
||||
BOOST_TEST(a1[0][0][1] == 1);
|
||||
BOOST_TEST(a1[1][1][0] == 2);
|
||||
BOOST_TEST(a1[1][1][1] == 3);
|
||||
}
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user