forked from boostorg/smart_ptr
Update allocate_shared array unit tests
Tests that do not always use allocator bound for element_type.
This commit is contained in:
@@ -9,7 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
#include <boost/smart_ptr/make_shared.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
template<class T>
|
||||
template<class T = void>
|
||||
struct creator {
|
||||
typedef T value_type;
|
||||
|
||||
@@ -66,7 +66,7 @@ int main()
|
||||
}
|
||||
{
|
||||
boost::shared_ptr<const int[][2]> result =
|
||||
boost::allocate_shared<const int[][2]>(creator<int>(), 2, {0, 1});
|
||||
boost::allocate_shared<const int[][2]>(creator<>(), 2, {0, 1});
|
||||
BOOST_TEST(result[0][0] == 0);
|
||||
BOOST_TEST(result[0][1] == 1);
|
||||
BOOST_TEST(result[1][0] == 0);
|
||||
@@ -74,7 +74,7 @@ int main()
|
||||
}
|
||||
{
|
||||
boost::shared_ptr<const int[2][2]> result =
|
||||
boost::allocate_shared<const int[2][2]>(creator<int>(), {0, 1});
|
||||
boost::allocate_shared<const int[2][2]>(creator<>(), {0, 1});
|
||||
BOOST_TEST(result[0][0] == 0);
|
||||
BOOST_TEST(result[0][1] == 1);
|
||||
BOOST_TEST(result[1][0] == 0);
|
||||
|
||||
Reference in New Issue
Block a user