forked from boostorg/smart_ptr
Correct call to init_list in make_shared and allocate_shared. Move g++ failing case into separate test to not mask other issues.
[SVN r81905]
This commit is contained in:
@ -118,7 +118,7 @@ namespace boost {
|
||||
p3 = reinterpret_cast<T3*>(list);
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init_list<M>(p2, p3);
|
||||
d2->template init_list<M>(p2, p3);
|
||||
return boost::shared_ptr<T>(s1, p1);
|
||||
}
|
||||
template<typename T, typename A>
|
||||
@ -142,7 +142,7 @@ namespace boost {
|
||||
p3 = reinterpret_cast<T3*>(list);
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init_list<M>(p2, p3);
|
||||
d2->template init_list<M>(p2, p3);
|
||||
return boost::shared_ptr<T>(s1, p1);
|
||||
}
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
|
@ -118,7 +118,7 @@ namespace boost {
|
||||
p3 = reinterpret_cast<T3*>(list);
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init_list<M>(p2, p3);
|
||||
d2->template init_list<M>(p2, p3);
|
||||
return boost::shared_ptr<T>(s1, p1);
|
||||
}
|
||||
template<typename T>
|
||||
@ -141,7 +141,7 @@ namespace boost {
|
||||
p3 = reinterpret_cast<T3*>(list);
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init_list<M>(p2, p3);
|
||||
d2->template init_list<M>(p2, p3);
|
||||
return boost::shared_ptr<T>(s1, p1);
|
||||
}
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
|
@ -139,6 +139,7 @@ import testing ;
|
||||
[ run make_shared_array_create_test.cpp ]
|
||||
[ run make_shared_array_init_test.cpp ]
|
||||
[ run make_shared_arrays_create_test.cpp ]
|
||||
[ run make_shared_arrays_init_test.cpp ]
|
||||
[ run make_shared_array_throws_test.cpp ]
|
||||
[ run make_shared_array_esft_test.cpp ]
|
||||
[ run make_shared_array_args_test.cpp ]
|
||||
@ -147,6 +148,7 @@ import testing ;
|
||||
[ run allocate_shared_array_create_test.cpp ]
|
||||
[ run allocate_shared_array_init_test.cpp ]
|
||||
[ run allocate_shared_arrays_create_test.cpp ]
|
||||
[ run allocate_shared_arrays_init_test.cpp ]
|
||||
[ run allocate_shared_array_throws_test.cpp ]
|
||||
[ run allocate_shared_array_esft_test.cpp ]
|
||||
[ run allocate_shared_array_args_test.cpp ]
|
||||
|
@ -72,13 +72,6 @@ int main() {
|
||||
BOOST_TEST(a1[2] == 2);
|
||||
BOOST_TEST(a1[3] == 3);
|
||||
}
|
||||
{
|
||||
boost::shared_ptr<int[][2]> a1 = boost::allocate_shared<int[][2]>(std::allocator<int>(), { {0, 1}, {2, 3} });
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
BOOST_TEST(a1[0][1] == 1);
|
||||
BOOST_TEST(a1[1][0] == 2);
|
||||
BOOST_TEST(a1[1][1] == 3);
|
||||
}
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
{
|
||||
|
23
test/allocate_shared_arrays_init_test.cpp
Normal file
23
test/allocate_shared_arrays_init_test.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Glen Joseph Fernandes
|
||||
* glenfe at live dot com
|
||||
*
|
||||
* Distributed under the Boost Software License,
|
||||
* Version 1.0. (See accompanying file LICENSE_1_0.txt
|
||||
* or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/allocate_shared_array.hpp>
|
||||
|
||||
int main() {
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
{
|
||||
boost::shared_ptr<int[][2]> a1 = boost::allocate_shared<int[][2]>(std::allocator<int>(), { {0, 1}, {2, 3} });
|
||||
BOOST_TEST(a1[0][0] == 0);
|
||||
BOOST_TEST(a1[0][1] == 1);
|
||||
BOOST_TEST(a1[1][0] == 2);
|
||||
BOOST_TEST(a1[1][1] == 3);
|
||||
}
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
@ -72,13 +72,6 @@ int main() {
|
||||
BOOST_TEST(a1[2] == 2);
|
||||
BOOST_TEST(a1[3] == 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);
|
||||
BOOST_TEST(a1[1][1] == 3);
|
||||
}
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
{
|
||||
|
23
test/make_shared_arrays_init_test.cpp
Normal file
23
test/make_shared_arrays_init_test.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Glen Joseph Fernandes
|
||||
* glenfe at live dot com
|
||||
*
|
||||
* Distributed under the Boost Software License,
|
||||
* Version 1.0. (See accompanying file LICENSE_1_0.txt
|
||||
* or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/smart_ptr/make_shared_array.hpp>
|
||||
|
||||
int main() {
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
{
|
||||
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);
|
||||
BOOST_TEST(a1[1][1] == 3);
|
||||
}
|
||||
#endif
|
||||
return boost::report_errors();
|
||||
}
|
Reference in New Issue
Block a user