forked from boostorg/smart_ptr
Minor cosmetic changes in make_shared for arrays
This commit is contained in:
@@ -9,11 +9,11 @@
|
||||
#ifndef BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
|
||||
#define BOOST_SMART_PTR_ALLOCATE_SHARED_ARRAY_HPP
|
||||
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/detail/allocate_array_helper.hpp>
|
||||
#include <boost/smart_ptr/detail/array_deleter.hpp>
|
||||
#include <boost/smart_ptr/detail/array_traits.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_if_array.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
|
||||
namespace boost {
|
||||
template<typename T, typename A>
|
||||
@@ -21,13 +21,14 @@ namespace boost {
|
||||
allocate_shared(const A& allocator, std::size_t size) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p2 = 0;
|
||||
std::size_t n1 = size * boost::detail::array_total<T1>::size;
|
||||
boost::detail::allocate_array_helper<A, T2[]> a1(allocator, n1, &p2);
|
||||
boost::detail::array_deleter<T2[]> d1(n1);
|
||||
boost::detail::allocate_array_helper<A, T3[]> a1(allocator, n1, &p2);
|
||||
boost::detail::array_deleter<T3[]> d1(n1);
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init(p2);
|
||||
@@ -39,15 +40,16 @@ namespace boost {
|
||||
allocate_shared(const A& allocator) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
enum {
|
||||
N = boost::detail::array_total<T>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
boost::detail::allocate_array_helper<A, T2[N]> a1(allocator, &p2);
|
||||
boost::detail::array_deleter<T2[N]> d1;
|
||||
T3* p2 = 0;
|
||||
boost::detail::allocate_array_helper<A, T3[N]> a1(allocator, &p2);
|
||||
boost::detail::array_deleter<T3[N]> d1;
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[N]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[N]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init(p2);
|
||||
@@ -57,22 +59,22 @@ namespace boost {
|
||||
template<typename T, typename A>
|
||||
inline typename boost::detail::sp_if_array<T>::type
|
||||
allocate_shared(const A& allocator, std::size_t size,
|
||||
const typename boost::detail::array_inner<T>::type& list) {
|
||||
const typename boost::detail::array_inner<T>::type& value) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef const T2 T3;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
typedef const T2 T4;
|
||||
enum {
|
||||
M = boost::detail::array_total<T1>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p3 = 0;
|
||||
T3* p2 = 0;
|
||||
T4* p3 = reinterpret_cast<T4*>(&value);
|
||||
std::size_t n1 = M * size;
|
||||
boost::detail::allocate_array_helper<A, T2[]> a1(allocator, n1, &p2);
|
||||
boost::detail::array_deleter<T2[]> d1(n1);
|
||||
boost::detail::allocate_array_helper<A, T3[]> a1(allocator, n1, &p2);
|
||||
boost::detail::array_deleter<T3[]> d1(n1);
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[]>* D2;
|
||||
p3 = reinterpret_cast<T3*>(&list);
|
||||
typedef boost::detail::array_deleter<T3[]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->template init<M>(p2, p3);
|
||||
@@ -81,23 +83,23 @@ namespace boost {
|
||||
|
||||
template<typename T, typename A>
|
||||
inline typename boost::detail::sp_if_size_array<T>::type
|
||||
allocate_shared(const A& allocator,
|
||||
const typename boost::detail::array_inner<T>::type& list) {
|
||||
allocate_shared(const A& allocator,
|
||||
const typename boost::detail::array_inner<T>::type& value) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef const T2 T3;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
typedef const T2 T4;
|
||||
enum {
|
||||
M = boost::detail::array_total<T1>::size,
|
||||
N = boost::detail::array_total<T>::size
|
||||
N = boost::detail::array_total<T>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p3 = 0;
|
||||
boost::detail::allocate_array_helper<A, T2[N]> a1(allocator, &p2);
|
||||
boost::detail::array_deleter<T2[N]> d1;
|
||||
T3* p2 = 0;
|
||||
T4* p3 = reinterpret_cast<T4*>(&value);
|
||||
boost::detail::allocate_array_helper<A, T3[N]> a1(allocator, &p2);
|
||||
boost::detail::array_deleter<T3[N]> d1;
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[N]>* D2;
|
||||
p3 = reinterpret_cast<T3*>(&list);
|
||||
typedef boost::detail::array_deleter<T3[N]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->template init<M>(p2, p3);
|
||||
@@ -109,13 +111,14 @@ namespace boost {
|
||||
allocate_shared_noinit(const A& allocator, std::size_t size) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p2 = 0;
|
||||
std::size_t n1 = size * boost::detail::array_total<T1>::size;
|
||||
boost::detail::allocate_array_helper<A, T2[]> a1(allocator, n1, &p2);
|
||||
boost::detail::array_deleter<T2[]> d1(n1);
|
||||
boost::detail::allocate_array_helper<A, T3[]> a1(allocator, n1, &p2);
|
||||
boost::detail::array_deleter<T3[]> d1(n1);
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->noinit(p2);
|
||||
@@ -127,15 +130,16 @@ namespace boost {
|
||||
allocate_shared_noinit(const A& allocator) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
enum {
|
||||
N = boost::detail::array_total<T>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
boost::detail::allocate_array_helper<A, T2[N]> a1(allocator, &p2);
|
||||
boost::detail::array_deleter<T2[N]> d1;
|
||||
T3* p2 = 0;
|
||||
boost::detail::allocate_array_helper<A, T3[N]> a1(allocator, &p2);
|
||||
boost::detail::array_deleter<T3[N]> d1;
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[N]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[N]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->noinit(p2);
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_DELETER_HPP
|
||||
#define BOOST_SMART_PTR_DETAIL_ARRAY_DELETER_HPP
|
||||
|
||||
#include <boost/smart_ptr/detail/array_traits.hpp>
|
||||
#include <boost/smart_ptr/detail/array_utility.hpp>
|
||||
|
||||
namespace boost {
|
||||
@@ -35,9 +36,9 @@ namespace boost {
|
||||
object = memory;
|
||||
}
|
||||
|
||||
template<std::size_t M>
|
||||
void init(T* memory, const T* list) {
|
||||
array_init<T, M>(memory, size, list);
|
||||
template<std::size_t N>
|
||||
void init(T* memory, const T* value) {
|
||||
array_init<T, N>(memory, size, value);
|
||||
object = memory;
|
||||
}
|
||||
|
||||
@@ -77,8 +78,8 @@ namespace boost {
|
||||
}
|
||||
|
||||
template<std::size_t M>
|
||||
void init(T* memory, const T* list) {
|
||||
array_init<T, M>(memory, N, list);
|
||||
void init(T* memory, const T* value) {
|
||||
array_init<T, M>(memory, N, value);
|
||||
object = memory;
|
||||
}
|
||||
|
||||
|
@@ -9,13 +9,13 @@
|
||||
#ifndef BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
|
||||
#define BOOST_SMART_PTR_DETAIL_ARRAY_TRAITS_HPP
|
||||
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#include <cstddef>
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
template<typename T>
|
||||
struct array_base {
|
||||
typedef typename boost::remove_cv<T>::type type;
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
|
@@ -16,11 +16,13 @@
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
template<typename T>
|
||||
inline void array_destroy(T*, std::size_t, boost::true_type) {
|
||||
inline void array_destroy(T*, std::size_t,
|
||||
boost::true_type) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void array_destroy(T* memory, std::size_t size, boost::false_type) {
|
||||
inline void array_destroy(T* memory, std::size_t size,
|
||||
boost::false_type) {
|
||||
for (std::size_t i = size; i > 0; ) {
|
||||
memory[--i].~T();
|
||||
}
|
||||
@@ -33,7 +35,8 @@ namespace boost {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void array_value(T* memory, std::size_t size, boost::true_type) {
|
||||
inline void array_value(T* memory, std::size_t size,
|
||||
boost::true_type) {
|
||||
for (std::size_t i = 0; i < size; i++) {
|
||||
void* p1 = memory + i;
|
||||
::new(p1) T();
|
||||
@@ -41,7 +44,8 @@ namespace boost {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void array_value(T* memory, std::size_t size, boost::false_type) {
|
||||
inline void array_value(T* memory, std::size_t size,
|
||||
boost::false_type) {
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
std::size_t i = 0;
|
||||
try {
|
||||
@@ -68,7 +72,8 @@ namespace boost {
|
||||
}
|
||||
|
||||
template<typename T, std::size_t N>
|
||||
inline void array_init(T* memory, std::size_t size, const T* list) {
|
||||
inline void array_init(T* memory, std::size_t size,
|
||||
const T* list) {
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
std::size_t i = 0;
|
||||
try {
|
||||
@@ -89,11 +94,13 @@ namespace boost {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void array_default(T*, std::size_t, boost::true_type) {
|
||||
inline void array_default(T*, std::size_t,
|
||||
boost::true_type) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void array_default(T* memory, std::size_t size, boost::false_type) {
|
||||
inline void array_default(T* memory, std::size_t size,
|
||||
boost::false_type) {
|
||||
#if !defined(BOOST_NO_EXCEPTIONS)
|
||||
std::size_t i = 0;
|
||||
try {
|
||||
|
@@ -9,11 +9,11 @@
|
||||
#ifndef BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
|
||||
#define BOOST_SMART_PTR_MAKE_SHARED_ARRAY_HPP
|
||||
|
||||
#include <boost/smart_ptr/shared_ptr.hpp>
|
||||
#include <boost/smart_ptr/detail/array_deleter.hpp>
|
||||
#include <boost/smart_ptr/detail/array_traits.hpp>
|
||||
#include <boost/smart_ptr/detail/make_array_helper.hpp>
|
||||
#include <boost/smart_ptr/detail/sp_if_array.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
|
||||
namespace boost {
|
||||
template<typename T>
|
||||
@@ -21,13 +21,14 @@ namespace boost {
|
||||
make_shared(std::size_t size) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p2 = 0;
|
||||
std::size_t n1 = size * boost::detail::array_total<T1>::size;
|
||||
boost::detail::make_array_helper<T2[]> a1(n1, &p2);
|
||||
boost::detail::array_deleter<T2[]> d1(n1);
|
||||
boost::detail::make_array_helper<T3[]> a1(n1, &p2);
|
||||
boost::detail::array_deleter<T3[]> d1(n1);
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init(p2);
|
||||
@@ -39,15 +40,16 @@ namespace boost {
|
||||
make_shared() {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
enum {
|
||||
N = boost::detail::array_total<T>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
boost::detail::make_array_helper<T2[N]> a1(&p2);
|
||||
boost::detail::array_deleter<T2[N]> d1;
|
||||
T3* p2 = 0;
|
||||
boost::detail::make_array_helper<T3[N]> a1(&p2);
|
||||
boost::detail::array_deleter<T3[N]> d1;
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[N]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[N]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->init(p2);
|
||||
@@ -57,22 +59,22 @@ namespace boost {
|
||||
template<typename T>
|
||||
inline typename boost::detail::sp_if_array<T>::type
|
||||
make_shared(std::size_t size,
|
||||
const typename boost::detail::array_inner<T>::type& list) {
|
||||
const typename boost::detail::array_inner<T>::type& value) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef const T2 T3;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
typedef const T2 T4;
|
||||
enum {
|
||||
M = boost::detail::array_total<T1>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p3 = 0;
|
||||
T3* p2 = 0;
|
||||
T4* p3 = reinterpret_cast<T4*>(&value);
|
||||
std::size_t n1 = M * size;
|
||||
boost::detail::make_array_helper<T2[]> a1(n1, &p2);
|
||||
boost::detail::array_deleter<T2[]> d1(n1);
|
||||
boost::detail::make_array_helper<T3[]> a1(n1, &p2);
|
||||
boost::detail::array_deleter<T3[]> d1(n1);
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[]>* D2;
|
||||
p3 = reinterpret_cast<T3*>(&list);
|
||||
typedef boost::detail::array_deleter<T3[]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->template init<M>(p2, p3);
|
||||
@@ -81,22 +83,22 @@ namespace boost {
|
||||
|
||||
template<typename T>
|
||||
inline typename boost::detail::sp_if_size_array<T>::type
|
||||
make_shared(const typename boost::detail::array_inner<T>::type& list) {
|
||||
make_shared(const typename boost::detail::array_inner<T>::type& value) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef const T2 T3;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
typedef const T2 T4;
|
||||
enum {
|
||||
M = boost::detail::array_total<T1>::size,
|
||||
N = boost::detail::array_total<T>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p3 = 0;
|
||||
boost::detail::make_array_helper<T2[N]> a1(&p2);
|
||||
boost::detail::array_deleter<T2[N]> d1;
|
||||
T3* p2 = 0;
|
||||
T4* p3 = reinterpret_cast<T4*>(&value);
|
||||
boost::detail::make_array_helper<T3[N]> a1(&p2);
|
||||
boost::detail::array_deleter<T3[N]> d1;
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[N]>* D2;
|
||||
p3 = reinterpret_cast<T3*>(&list);
|
||||
typedef boost::detail::array_deleter<T3[N]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->template init<M>(p2, p3);
|
||||
@@ -108,13 +110,14 @@ namespace boost {
|
||||
make_shared_noinit(std::size_t size) {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
T3* p2 = 0;
|
||||
std::size_t n1 = size * boost::detail::array_total<T1>::size;
|
||||
boost::detail::make_array_helper<T2[]> a1(n1, &p2);
|
||||
boost::detail::array_deleter<T2[]> d1(n1);
|
||||
boost::detail::make_array_helper<T3[]> a1(n1, &p2);
|
||||
boost::detail::array_deleter<T3[]> d1(n1);
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->noinit(p2);
|
||||
@@ -126,15 +129,16 @@ namespace boost {
|
||||
make_shared_noinit() {
|
||||
typedef typename boost::detail::array_inner<T>::type T1;
|
||||
typedef typename boost::detail::array_base<T1>::type T2;
|
||||
typedef typename boost::remove_cv<T2>::type T3;
|
||||
enum {
|
||||
N = boost::detail::array_total<T>::size
|
||||
};
|
||||
T1* p1 = 0;
|
||||
T2* p2 = 0;
|
||||
boost::detail::make_array_helper<T2[N]> a1(&p2);
|
||||
boost::detail::array_deleter<T2[N]> d1;
|
||||
T3* p2 = 0;
|
||||
boost::detail::make_array_helper<T3[N]> a1(&p2);
|
||||
boost::detail::array_deleter<T3[N]> d1;
|
||||
boost::shared_ptr<T> s1(p1, d1, a1);
|
||||
typedef boost::detail::array_deleter<T2[N]>* D2;
|
||||
typedef boost::detail::array_deleter<T3[N]>* D2;
|
||||
p1 = reinterpret_cast<T1*>(p2);
|
||||
D2 d2 = static_cast<D2>(s1._internal_get_untyped_deleter());
|
||||
d2->noinit(p2);
|
||||
|
@@ -5,7 +5,7 @@
|
||||
* 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>
|
||||
#include <boost/smart_ptr/weak_ptr.hpp>
|
||||
|
@@ -84,8 +84,7 @@ int main() {
|
||||
try {
|
||||
boost::allocate_shared_noinit<type[6]>(std::allocator<type>());
|
||||
BOOST_ERROR("allocate_shared_noinit did not throw");
|
||||
}
|
||||
catch (...) {
|
||||
} catch (...) {
|
||||
BOOST_TEST(type::instances == 0);
|
||||
}
|
||||
|
||||
@@ -93,8 +92,7 @@ int main() {
|
||||
try {
|
||||
boost::allocate_shared_noinit<type[3][2]>(std::allocator<type>());
|
||||
BOOST_ERROR("allocate_shared_noinit did not throw");
|
||||
}
|
||||
catch (...) {
|
||||
} catch (...) {
|
||||
BOOST_TEST(type::instances == 0);
|
||||
}
|
||||
|
||||
|
@@ -84,8 +84,7 @@ int main() {
|
||||
try {
|
||||
boost::make_shared_noinit<type[6]>();
|
||||
BOOST_ERROR("make_shared_noinit did not throw");
|
||||
}
|
||||
catch (...) {
|
||||
} catch (...) {
|
||||
BOOST_TEST(type::instances == 0);
|
||||
}
|
||||
|
||||
@@ -93,8 +92,7 @@ int main() {
|
||||
try {
|
||||
boost::make_shared_noinit<type[3][2]>();
|
||||
BOOST_ERROR("make_shared_noinit did not throw");
|
||||
}
|
||||
catch (...) {
|
||||
} catch (...) {
|
||||
BOOST_TEST(type::instances == 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user