mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-10-26 05:11:42 +01:00
Change make_shared and allocate_shared array form semantics with initializer lists overload that takes no size.
[SVN r81259]
This commit is contained in:
@@ -76,14 +76,14 @@ int main() {
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
{
|
||||
boost::shared_ptr<int[]> a1 = boost::make_shared<int[]>(4, { 0, 1, 2, 3 });
|
||||
boost::shared_ptr<int[]> a1 = boost::make_shared<int[]>({ 0, 1, 2, 3 });
|
||||
BOOST_TEST(a1[0] == 0);
|
||||
BOOST_TEST(a1[1] == 1);
|
||||
BOOST_TEST(a1[2] == 2);
|
||||
BOOST_TEST(a1[3] == 3);
|
||||
}
|
||||
{
|
||||
boost::shared_ptr<int[][2]> a1 = boost::make_shared<int[][2]>(2, { {0, 1}, {2, 3} });
|
||||
boost::shared_ptr<int[][2]> a1 = boost::make_shared<int[][2]>({ {0, 1}, {2, 3} });
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
BOOST_TEST(a1[0][1] == 1);
|
||||
BOOST_TEST(a1[1][0] == 2);
|
||||
|
||||
Reference in New Issue
Block a user