Compare commits

...

20 Commits

Author SHA1 Message Date
Peter Dimov
cd01b87478 Update test/Jamfile 2024-10-07 14:19:59 +03:00
Peter Dimov
b3a4c39456 Update build.jam 2024-10-06 22:07:47 +03:00
Peter Dimov
5cdd3585db Regenerate CMakeLists.txt 2024-10-06 22:06:23 +03:00
Peter Dimov
916c8a7d7c Remove uses of boost::type_with_alignment 2024-10-06 21:03:51 +03:00
Peter Dimov
beaf20e7b5 Add sp_type_with_alignment 2024-10-06 20:56:48 +03:00
Peter Dimov
5e6b3a9702 Remove use of boost::type_identity 2024-10-06 20:32:29 +03:00
Peter Dimov
63589908b5 Add sp_type_identity 2024-10-06 20:29:27 +03:00
Peter Dimov
9466e73cbe Remove uses of boost::is_unbounded_array 2024-10-06 20:08:02 +03:00
Peter Dimov
b12e342c52 Remove uses of boost::is_bounded_array 2024-10-06 20:04:34 +03:00
Peter Dimov
7f880bc205 Add sp_is_unbounded_array 2024-10-06 19:58:40 +03:00
Peter Dimov
90fd5a1fc9 Add detail/sp_type_traits.hpp, sp_is_bounded_array 2024-10-06 19:54:45 +03:00
Peter Dimov
0bedddbf16 Remove uses of boost::is_array 2024-10-06 19:35:07 +03:00
Peter Dimov
173cf9ad7b Remove uses of boost::remove_cv 2024-10-06 19:28:42 +03:00
Peter Dimov
9db2b96843 Remove uses of boost::remove_extent 2024-10-06 19:26:17 +03:00
Peter Dimov
9b309184f8 Remove uses of boost::extent 2024-10-06 19:23:15 +03:00
Peter Dimov
7c87ae7985 Remove use of boost::remove_const 2024-10-06 19:19:48 +03:00
Peter Dimov
f2abcf1654 Remove uses of boost::enable_if_ 2024-10-06 19:16:42 +03:00
Peter Dimov
1361171bac Remove uses of boost::alignment_of 2024-10-06 18:57:30 +03:00
Peter Dimov
c5023afe04 Remove uses of boost::is_convertible 2024-10-06 18:48:33 +03:00
Peter Dimov
7cfc326207 Remove uses of boost::remove_reference 2024-10-06 18:44:04 +03:00
30 changed files with 433 additions and 288 deletions

View File

@@ -18,7 +18,6 @@ target_link_libraries(boost_smart_ptr
Boost::config
Boost::core
Boost::throw_exception
Boost::type_traits
)
target_compile_features(boost_smart_ptr INTERFACE cxx_std_11)

View File

@@ -10,7 +10,6 @@ constant boost_dependencies :
/boost/config//boost_config
/boost/core//boost_core
/boost/throw_exception//boost_throw_exception
/boost/type_traits//boost_type_traits
;
project /boost/smart_ptr ;

View File

@@ -10,6 +10,8 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/smart_ptr/allocate_shared_array.hpp>
#include <boost/smart_ptr/local_shared_ptr.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>
namespace boost {
namespace detail {
@@ -69,7 +71,7 @@ private:
} /* detail */
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared(const A& allocator, std::size_t count)
{
@@ -89,12 +91,12 @@ allocate_local_shared(const A& allocator, std::size_t count)
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared(const A& allocator)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
@@ -112,10 +114,10 @@ allocate_local_shared(const A& allocator)
}
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared(const A& allocator, std::size_t count,
const typename remove_extent<T>::type& value)
const typename std::remove_extent<T>::type& value)
{
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
@@ -133,13 +135,13 @@ allocate_local_shared(const A& allocator, std::size_t count,
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared(const A& allocator,
const typename remove_extent<T>::type& value)
const typename std::remove_extent<T>::type& value)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
@@ -157,7 +159,7 @@ allocate_local_shared(const A& allocator,
}
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared_noinit(const A& allocator, std::size_t count)
{
@@ -166,7 +168,7 @@ allocate_local_shared_noinit(const A& allocator, std::size_t count)
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
allocate_local_shared_noinit(const A& allocator)
{

View File

@@ -12,22 +12,16 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/alloc_construct.hpp>
#include <boost/core/first_scalar.hpp>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/enable_if.hpp>
#include <boost/type_traits/extent.hpp>
#include <boost/type_traits/is_bounded_array.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_extent.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>
namespace boost {
namespace detail {
template<class T>
struct sp_array_element {
typedef typename boost::remove_cv<typename
boost::remove_extent<T>::type>::type type;
typedef typename std::remove_cv<typename
std::remove_extent<T>::type>::type type;
};
template<class T>
@@ -112,8 +106,8 @@ private:
template<class T, class U>
struct sp_array_alignment {
enum {
value = sp_max_size<boost::alignment_of<T>::value,
boost::alignment_of<U>::value>::value
value = sp_max_size<std::alignment_of<T>::value,
std::alignment_of<U>::value>::value
};
};
@@ -142,7 +136,7 @@ class sp_array_creator {
offset = sp_array_offset<T, element>::value
};
typedef typename boost::type_with_alignment<sp_array_alignment<T,
typedef typename sp_type_with_alignment<sp_array_alignment<T,
element>::value>::type type;
public:
@@ -258,7 +252,7 @@ private:
} /* detail */
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type
allocate_shared(const A& allocator, std::size_t count)
{
typedef typename detail::sp_array_element<T>::type element;
@@ -275,15 +269,15 @@ allocate_shared(const A& allocator, std::size_t count)
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared(const A& allocator)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
typedef detail::sp_size_array_state<other, extent<T>::value> state;
typedef detail::sp_size_array_state<other, std::extent<T>::value> state;
typedef detail::sp_array_base<state> base;
detail::sp_array_result<other, base> result(allocator, count);
base* node = result.get();
@@ -295,9 +289,9 @@ allocate_shared(const A& allocator)
}
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type
allocate_shared(const A& allocator, std::size_t count,
const typename remove_extent<T>::type& value)
const typename std::remove_extent<T>::type& value)
{
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
@@ -313,16 +307,16 @@ allocate_shared(const A& allocator, std::size_t count,
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared(const A& allocator,
const typename remove_extent<T>::type& value)
const typename std::remove_extent<T>::type& value)
{
enum {
count = extent<T>::value
count = std::extent<T>::value
};
typedef typename detail::sp_array_element<T>::type element;
typedef typename allocator_rebind<A, element>::type other;
typedef detail::sp_size_array_state<other, extent<T>::value> state;
typedef detail::sp_size_array_state<other, std::extent<T>::value> state;
typedef detail::sp_array_base<state> base;
detail::sp_array_result<other, base> result(allocator, count);
base* node = result.get();
@@ -334,14 +328,14 @@ allocate_shared(const A& allocator,
}
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type
allocate_shared_noinit(const A& allocator, std::size_t count)
{
return boost::allocate_shared<T>(boost::noinit_adapt(allocator), count);
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
allocate_shared_noinit(const A& allocator)
{
return boost::allocate_shared<T>(boost::noinit_adapt(allocator));

View File

@@ -14,18 +14,12 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/first_scalar.hpp>
#include <boost/core/noinit_adaptor.hpp>
#include <boost/core/pointer_traits.hpp>
#include <boost/type_traits/enable_if.hpp>
#include <boost/type_traits/extent.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_bounded_array.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
#include <boost/type_traits/remove_cv.hpp>
#include <boost/type_traits/remove_extent.hpp>
#include <boost/type_traits/type_identity.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/config.hpp>
#include <memory>
#include <utility>
#include <cstddef>
#include <type_traits>
namespace boost {
namespace detail {
@@ -57,8 +51,8 @@ struct sp_alloc_result<T[N]> {
template<class T>
struct sp_alloc_value {
typedef typename boost::remove_cv<typename
boost::remove_extent<T>::type>::type type;
typedef typename std::remove_cv<typename
std::remove_extent<T>::type>::type type;
};
template<class T, class P>
@@ -71,7 +65,7 @@ public:
#if defined(BOOST_MSVC) && BOOST_MSVC == 1600
sp_alloc_ptr(T* p) noexcept
: p_(const_cast<typename boost::remove_cv<T>::type*>(p)) { }
: p_(const_cast<typename std::remove_cv<T>::type*>(p)) { }
#endif
sp_alloc_ptr(std::size_t, P p) noexcept
@@ -108,7 +102,7 @@ public:
static sp_alloc_ptr pointer_to(T& v) {
return sp_alloc_ptr(1,
std::pointer_traits<P>::pointer_to(const_cast<typename
boost::remove_cv<T>::type&>(v)));
std::remove_cv<T>::type&>(v)));
}
#endif
@@ -155,7 +149,7 @@ public:
static sp_alloc_ptr pointer_to(T& v) {
return sp_alloc_ptr(n_,
std::pointer_traits<P>::pointer_to(const_cast<typename
boost::remove_cv<T>::type&>(v)));
std::remove_cv<T>::type&>(v)));
}
#endif
@@ -202,7 +196,7 @@ public:
static sp_alloc_ptr pointer_to(T& v) {
return sp_alloc_ptr(N,
std::pointer_traits<P>::pointer_to(const_cast<typename
boost::remove_cv<T>::type&>(v)));
std::remove_cv<T>::type&>(v)));
}
#endif
@@ -259,7 +253,7 @@ operator!=(std::nullptr_t,
template<class A>
inline void
sp_alloc_clear(A& a, typename boost::allocator_pointer<A>::type p, std::size_t,
boost::false_type)
std::false_type)
{
boost::alloc_destroy(a, boost::to_address(p));
}
@@ -267,7 +261,7 @@ sp_alloc_clear(A& a, typename boost::allocator_pointer<A>::type p, std::size_t,
template<class A>
inline void
sp_alloc_clear(A& a, typename boost::allocator_pointer<A>::type p,
std::size_t n, boost::true_type)
std::size_t n, std::true_type)
{
#if defined(BOOST_MSVC) && BOOST_MSVC < 1800
if (!p) {
@@ -296,7 +290,7 @@ public:
: base(empty_init_t(), a) { }
void operator()(pointer p) {
detail::sp_alloc_clear(base::get(), p.ptr(), p.size(), is_array<T>());
detail::sp_alloc_clear(base::get(), p.ptr(), p.size(), std::is_array<T>());
base::get().deallocate(p.ptr(), p.size());
}
};
@@ -354,7 +348,7 @@ private:
} /* detail */
template<class T, class A>
inline typename enable_if_<!is_array<T>::value,
inline typename std::enable_if<!std::is_array<T>::value,
std::unique_ptr<T, alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc)
{
@@ -364,7 +358,7 @@ allocate_unique(const A& alloc)
}
template<class T, class A, class... Args>
inline typename enable_if_<!is_array<T>::value,
inline typename std::enable_if<!std::is_array<T>::value,
std::unique_ptr<T, alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc, Args&&... args)
{
@@ -374,9 +368,9 @@ allocate_unique(const A& alloc, Args&&... args)
}
template<class T, class A>
inline typename enable_if_<!is_array<T>::value,
inline typename std::enable_if<!std::is_array<T>::value,
std::unique_ptr<T, alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc, typename type_identity<T>::type&& value)
allocate_unique(const A& alloc, typename detail::sp_type_identity<T>::type&& value)
{
detail::sp_alloc_make<T, A> c(alloc, 1);
boost::alloc_construct(c.state(), c.get(), std::move(value));
@@ -384,7 +378,7 @@ allocate_unique(const A& alloc, typename type_identity<T>::type&& value)
}
template<class T, class A>
inline typename enable_if_<!is_array<T>::value,
inline typename std::enable_if<!std::is_array<T>::value,
std::unique_ptr<T, alloc_deleter<T, noinit_adaptor<A> > > >::type
allocate_unique_noinit(const A& alloc)
{
@@ -392,7 +386,7 @@ allocate_unique_noinit(const A& alloc)
}
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
std::unique_ptr<T, alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc, std::size_t size)
{
@@ -403,19 +397,19 @@ allocate_unique(const A& alloc, std::size_t size)
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc)
{
detail::sp_alloc_make<T, A> c(alloc, extent<T>::value);
detail::sp_alloc_make<T, A> c(alloc, std::extent<T>::value);
boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()),
detail::sp_alloc_size<T>::value);
return c.release();
}
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
std::unique_ptr<T, alloc_deleter<T, noinit_adaptor<A> > > >::type
allocate_unique_noinit(const A& alloc, std::size_t size)
{
@@ -423,7 +417,7 @@ allocate_unique_noinit(const A& alloc, std::size_t size)
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
alloc_deleter<T, noinit_adaptor<A> > > >::type
allocate_unique_noinit(const A& alloc)
@@ -432,29 +426,29 @@ allocate_unique_noinit(const A& alloc)
}
template<class T, class A>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
std::unique_ptr<T, alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc, std::size_t size,
const typename remove_extent<T>::type& value)
const typename std::remove_extent<T>::type& value)
{
detail::sp_alloc_make<T, A> c(alloc, size);
boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()),
size * detail::sp_alloc_size<T>::value, boost::first_scalar(&value),
detail::sp_alloc_size<typename remove_extent<T>::type>::value);
detail::sp_alloc_size<typename std::remove_extent<T>::type>::value);
return c.release();
}
template<class T, class A>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
std::unique_ptr<typename detail::sp_alloc_result<T>::type,
alloc_deleter<T, A> > >::type
allocate_unique(const A& alloc,
const typename remove_extent<T>::type& value)
const typename std::remove_extent<T>::type& value)
{
detail::sp_alloc_make<T, A> c(alloc, extent<T>::value);
detail::sp_alloc_make<T, A> c(alloc, std::extent<T>::value);
boost::alloc_construct_n(c.state(), boost::first_scalar(c.get()),
detail::sp_alloc_size<T>::value, boost::first_scalar(&value),
detail::sp_alloc_size<typename remove_extent<T>::type>::value);
detail::sp_alloc_size<typename std::remove_extent<T>::type>::value);
return c.release();
}

View File

@@ -21,21 +21,20 @@
#include <boost/config.hpp>
#include <boost/smart_ptr/detail/lightweight_mutex.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>
#include <new> // ::operator new, ::operator delete
#include <cstddef> // std::size_t
namespace boost
{
namespace detail
{
template<unsigned size, unsigned align_> union freeblock
{
typedef typename boost::type_with_alignment<align_>::type aligner_type;
typedef typename sp_type_with_alignment<align_>::type aligner_type;
aligner_type aligner;
char bytes[size];
freeblock * next;
@@ -74,7 +73,7 @@ template<unsigned size, unsigned align_> struct allocator_impl
static lightweight_mutex & mutex()
{
static freeblock< sizeof( lightweight_mutex ), boost::alignment_of< lightweight_mutex >::value > fbm;
static freeblock< sizeof( lightweight_mutex ), std::alignment_of< lightweight_mutex >::value > fbm;
static lightweight_mutex * pm = new( &fbm ) lightweight_mutex;
return *pm;
}
@@ -188,7 +187,7 @@ template<unsigned size, unsigned align_>
unsigned allocator_impl<size, align_>::last = allocator_impl<size, align_>::items_per_page;
template<class T>
struct quick_allocator: public allocator_impl< sizeof(T), boost::alignment_of<T>::value >
struct quick_allocator: public allocator_impl< sizeof(T), std::alignment_of<T>::value >
{
};

View File

@@ -0,0 +1,55 @@
#ifndef BOOST_SMART_PTR_DETAIL_SP_TYPE_TRAITS_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_SP_TYPE_TRAITS_HPP_INCLUDED
// Copyright 2024 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <type_traits>
namespace boost
{
namespace detail
{
// std::is_bounded_array (C++20)
template<class T> struct sp_is_bounded_array: std::false_type
{
};
template<class T, std::size_t N> struct sp_is_bounded_array< T[N] >: std::true_type
{
};
// std::is_unbounded_array (C++20)
template<class T> struct sp_is_unbounded_array: std::false_type
{
};
template<class T> struct sp_is_unbounded_array< T[] >: std::true_type
{
};
// std::type_identity (C++20)
template<class T> struct sp_type_identity
{
typedef T type;
};
// boost::type_with_alignment
template<std::size_t A> struct sp_type_with_alignment
{
struct alignas(A) type
{
unsigned char padding[ A ];
};
};
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_TYPE_TRAITS_HPP_INCLUDED

View File

@@ -11,11 +11,13 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/default_allocator.hpp>
#include <boost/smart_ptr/allocate_local_shared_array.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>
namespace boost {
template<class T>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared()
{
@@ -24,16 +26,16 @@ make_local_shared()
}
template<class T>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared(const typename remove_extent<T>::type& value)
make_local_shared(const typename std::remove_extent<T>::type& value)
{
return boost::allocate_local_shared<T>(boost::default_allocator<typename
detail::sp_array_element<T>::type>(), value);
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared(std::size_t size)
{
@@ -42,17 +44,17 @@ make_local_shared(std::size_t size)
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared(std::size_t size,
const typename remove_extent<T>::type& value)
const typename std::remove_extent<T>::type& value)
{
return boost::allocate_local_shared<T>(boost::default_allocator<typename
detail::sp_array_element<T>::type>(), size, value);
}
template<class T>
inline typename enable_if_<is_bounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared_noinit()
{
@@ -61,7 +63,7 @@ make_local_shared_noinit()
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
local_shared_ptr<T> >::type
make_local_shared_noinit(std::size_t size)
{

View File

@@ -13,8 +13,8 @@
#include <boost/smart_ptr/local_shared_ptr.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/config.hpp>
#include <type_traits>
#include <utility>
#include <cstddef>
@@ -45,7 +45,7 @@ template<class T, class A> class lsp_ms_deleter: public local_counted_impl_em
{
private:
typedef typename sp_aligned_storage<sizeof(T), ::boost::alignment_of<T>::value>::type storage_type;
typedef typename sp_aligned_storage<sizeof(T), std::alignment_of<T>::value>::type storage_type;
storage_type storage_;
A a_;
@@ -155,13 +155,13 @@ template<class T, class A> typename boost::detail::lsp_if_not_array<T>::type all
template<class T, class... Args> typename boost::detail::lsp_if_not_array<T>::type make_local_shared( Args&&... args )
{
typedef typename boost::remove_const<T>::type T2;
typedef typename std::remove_const<T>::type T2;
return boost::allocate_local_shared<T2>( std::allocator<T2>(), std::forward<Args>(args)... );
}
template<class T> typename boost::detail::lsp_if_not_array<T>::type make_local_shared_noinit()
{
typedef typename boost::remove_const<T>::type T2;
typedef typename std::remove_const<T>::type T2;
return boost::allocate_shared_noinit<T2>( std::allocator<T2>() );
}

View File

@@ -10,11 +10,13 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/default_allocator.hpp>
#include <boost/smart_ptr/allocate_shared_array.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <type_traits>
namespace boost {
template<class T>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared()
{
return boost::allocate_shared<T>(boost::default_allocator<typename
@@ -22,15 +24,15 @@ make_shared()
}
template<class T>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared(const typename remove_extent<T>::type& value)
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared(const typename std::remove_extent<T>::type& value)
{
return boost::allocate_shared<T>(boost::default_allocator<typename
detail::sp_array_element<T>::type>(), value);
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type
make_shared(std::size_t size)
{
return boost::allocate_shared<T>(boost::default_allocator<typename
@@ -38,15 +40,15 @@ make_shared(std::size_t size)
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
make_shared(std::size_t size, const typename remove_extent<T>::type& value)
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type
make_shared(std::size_t size, const typename std::remove_extent<T>::type& value)
{
return boost::allocate_shared<T>(boost::default_allocator<typename
detail::sp_array_element<T>::type>(), size, value);
}
template<class T>
inline typename enable_if_<is_bounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_bounded_array<T>::value, shared_ptr<T> >::type
make_shared_noinit()
{
return boost::allocate_shared_noinit<T>(boost::default_allocator<typename
@@ -54,7 +56,7 @@ make_shared_noinit()
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value, shared_ptr<T> >::type
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value, shared_ptr<T> >::type
make_shared_noinit(std::size_t size)
{
return boost::allocate_shared_noinit<T>(boost::default_allocator<typename

View File

@@ -12,16 +12,15 @@
// See http://www.boost.org/libs/smart_ptr/ for documentation.
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/type_traits/type_with_alignment.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/config.hpp>
#include <utility>
#include <cstddef>
#include <new>
#include <type_traits>
namespace boost
{
namespace detail
{
@@ -30,7 +29,7 @@ template< std::size_t N, std::size_t A > struct sp_aligned_storage
union type
{
char data_[ N ];
typename boost::type_with_alignment< A >::type align_;
typename sp_type_with_alignment< A >::type align_;
};
};
@@ -38,7 +37,7 @@ template< class T > class sp_ms_deleter
{
private:
typedef typename sp_aligned_storage< sizeof( T ), ::boost::alignment_of< T >::value >::type storage_type;
typedef typename sp_aligned_storage< sizeof( T ), std::alignment_of< T >::value >::type storage_type;
bool initialized_;
storage_type storage_;
@@ -109,7 +108,7 @@ template< class T, class A > class sp_as_deleter
{
private:
typedef typename sp_aligned_storage< sizeof( T ), ::boost::alignment_of< T >::value >::type storage_type;
typedef typename sp_aligned_storage< sizeof( T ), std::alignment_of< T >::value >::type storage_type;
storage_type storage_;
A a_;

View File

@@ -8,58 +8,55 @@ Distributed under the Boost Software License, Version 1.0.
#ifndef BOOST_SMART_PTR_MAKE_UNIQUE_HPP
#define BOOST_SMART_PTR_MAKE_UNIQUE_HPP
#include <boost/type_traits/enable_if.hpp>
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_unbounded_array.hpp>
#include <boost/type_traits/remove_extent.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <memory>
#include <type_traits>
#include <utility>
namespace boost {
template<class T>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type
make_unique()
{
return std::unique_ptr<T>(new T());
}
template<class T, class... Args>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type
make_unique(Args&&... args)
{
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
}
template<class T>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
make_unique(typename remove_reference<T>::type&& value)
inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type
make_unique(typename std::remove_reference<T>::type&& value)
{
return std::unique_ptr<T>(new T(std::move(value)));
}
template<class T>
inline typename enable_if_<!is_array<T>::value, std::unique_ptr<T> >::type
inline typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T> >::type
make_unique_noinit()
{
return std::unique_ptr<T>(new T);
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
std::unique_ptr<T> >::type
make_unique(std::size_t size)
{
return std::unique_ptr<T>(new typename remove_extent<T>::type[size]());
return std::unique_ptr<T>(new typename std::remove_extent<T>::type[size]());
}
template<class T>
inline typename enable_if_<is_unbounded_array<T>::value,
inline typename std::enable_if<detail::sp_is_unbounded_array<T>::value,
std::unique_ptr<T> >::type
make_unique_noinit(std::size_t size)
{
return std::unique_ptr<T>(new typename remove_extent<T>::type[size]);
return std::unique_ptr<T>(new typename std::remove_extent<T>::type[size]);
}
} /* boost */

View File

@@ -14,15 +14,20 @@ import testing ;
project
: requirements
<library>/boost/smart_ptr//boost_smart_ptr
<library>/boost/core//boost_core
<library>/boost/align//boost_align
<library>/boost/atomic//boost_atomic
<library>/boost/container_hash//boost_container_hash
<library>/boost/bind//boost_bind
<library>/boost/move//boost_move
<toolset>gcc:<cxxflags>-Wno-non-virtual-dtor
<toolset>gcc:<cxxflags>-Wno-deprecated-declarations
<toolset>gcc:<cxxflags>-Wno-delete-non-virtual-dtor
;
local cnhash = <library>/boost/container_hash//boost_container_hash ;
# quick test (for CI)
run quick.cpp ;
@@ -79,8 +84,7 @@ run shared_ptr_convertible_test.cpp ;
run wp_convertible_test.cpp ;
run ip_convertible_test.cpp ;
run allocate_shared_test.cpp ;
run sp_atomic_test.cpp
: : : <library>/boost/atomic//boost_atomic ;
run sp_atomic_test.cpp ;
run esft_void_test.cpp ;
run esft_second_ptr_test.cpp ;
run make_shared_esft_test.cpp ;
@@ -95,11 +99,9 @@ compile-fail auto_ptr_lv_fail.cpp ;
run atomic_count_test2.cpp ;
run sp_typeinfo_test.cpp ;
compile make_shared_fp_test.cpp ;
run sp_hash_test.cpp
: : : $(cnhash) ;
run sp_hash_test.cpp ;
run get_deleter_array_test.cpp ;
run ip_hash_test.cpp
: : : $(cnhash) ;
run ip_hash_test.cpp ;
run owner_less_test.cpp ;
run sp_unique_ptr_test.cpp ;
run sp_array_test.cpp ;
@@ -216,10 +218,8 @@ run weak_from_this_test2.cpp ;
run sp_bml_unique_ptr_test.cpp ;
run sp_hash_test2.cpp
: : : $(cnhash) ;
run sp_hash_test3.cpp
: : : $(cnhash) ;
run sp_hash_test2.cpp ;
run sp_hash_test3.cpp ;
run pointer_cast_test2.cpp ;
@@ -241,8 +241,7 @@ compile make_shared_msvc_test.cpp ;
compile lwm_win32_cs_test.cpp ;
run atomic_sp_test.cpp
: : : <library>/boost/atomic//boost_atomic ;
run atomic_sp_test.cpp ;
run sp_constexpr_test.cpp ;
run sp_constexpr_test2.cpp ;
@@ -388,33 +387,29 @@ run owner_less_test2.cpp ;
run ip_hash_test2.cpp ;
run sp_hash_test4.cpp ;
run lsp_hash_test.cpp
: : : $(cnhash) ;
run lsp_hash_test.cpp ;
run lsp_hash_test2.cpp ;
local MT = <threading>multi <library>/boost/bind//boost_bind ;
run atomic_count_mt_test.cpp
: : : $(MT) ;
: : : <threading>multi ;
run spinlock_mt_test.cpp
: : : $(MT) ;
: : : <threading>multi ;
run spinlock_pool_mt_test.cpp
: : : $(MT) ;
: : : <threading>multi ;
run shared_ptr_mt_test.cpp
: : : $(MT) ;
: : : <threading>multi ;
run weak_ptr_mt_test.cpp
: : : $(MT) ;
: : : <threading>multi ;
compile sp_report_implementation.cpp ;
run sp_owner_hash_value_test.cpp ;
run wp_hash_test.cpp
: : : $(cnhash) ;
run wp_hash_test.cpp ;
run wp_hash_test2.cpp ;
run wp_unordered_test.cpp ;
@@ -424,3 +419,8 @@ run sp_unordered_test.cpp ;
run sp_unique_ptr_test2.cpp ;
run sp_move_only_deleter.cpp ;
run sp_is_bounded_array_test.cpp ;
run sp_is_unbounded_array_test.cpp ;
run sp_type_identity_test.cpp ;
run sp_type_with_alignment_test.cpp ;

View File

@@ -8,9 +8,9 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/smart_ptr/make_local_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/align/is_aligned.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <type_traits>
template<class T = void>
struct creator {
@@ -87,7 +87,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<int[3]> result =
@@ -95,7 +95,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<int[][2]> result =
@@ -103,7 +103,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<int[2][2]> result =
@@ -111,7 +111,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[]> result =
@@ -119,7 +119,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[3]> result =
@@ -127,7 +127,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[][2]> result =
@@ -135,7 +135,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[2][2]> result =
@@ -143,7 +143,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<type[]> result =
@@ -151,7 +151,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> other = result;
result.reset();
@@ -163,7 +163,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> other = result;
result.reset();
@@ -175,7 +175,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[][2]> other = result;
result.reset();
@@ -187,7 +187,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[2][2]> other = result;
result.reset();
@@ -199,7 +199,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[]> other = result;
result.reset();
@@ -211,7 +211,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[3]> other = result;
result.reset();
@@ -224,7 +224,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[][2]> other = result;
result.reset();
@@ -236,7 +236,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[2][2]> other = result;
result.reset();

View File

@@ -8,9 +8,9 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/smart_ptr/make_local_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/align/is_aligned.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <type_traits>
template<class T = void>
struct creator {
@@ -87,7 +87,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -98,7 +98,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -109,7 +109,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -121,7 +121,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -133,7 +133,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -144,7 +144,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -155,7 +155,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -167,7 +167,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -179,7 +179,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> w1 = result;
result.reset();
@@ -191,7 +191,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> w1 = result;
result.reset();
@@ -203,7 +203,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -214,7 +214,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -225,7 +225,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -236,7 +236,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -247,7 +247,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -258,7 +258,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);

View File

@@ -9,7 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/lightweight_test.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <type_traits>
template<class T = void>
struct creator {
@@ -86,7 +86,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<int[3]> result =
@@ -94,7 +94,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<int[][2]> result =
@@ -102,7 +102,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<int[2][2]> result =
@@ -110,7 +110,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[]> result =
@@ -118,7 +118,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[3]> result =
@@ -126,7 +126,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[][2]> result =
@@ -134,7 +134,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[2][2]> result =
@@ -142,7 +142,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<type[]> result =
@@ -150,7 +150,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> other = result;
result.reset();
@@ -162,7 +162,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> other = result;
result.reset();
@@ -174,7 +174,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[][2]> other = result;
result.reset();
@@ -186,7 +186,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[2][2]> other = result;
result.reset();
@@ -198,7 +198,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[]> other = result;
result.reset();
@@ -210,7 +210,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[3]> other = result;
result.reset();
@@ -223,7 +223,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[][2]> other = result;
result.reset();
@@ -235,7 +235,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[2][2]> other = result;
result.reset();

View File

@@ -9,7 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/lightweight_test.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <type_traits>
template<class T = void>
struct creator {
@@ -86,7 +86,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -97,7 +97,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -108,7 +108,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -120,7 +120,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -132,7 +132,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -143,7 +143,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -154,7 +154,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -166,7 +166,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -178,7 +178,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> w1 = result;
result.reset();
@@ -190,7 +190,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> w1 = result;
result.reset();
@@ -202,7 +202,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -213,7 +213,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -224,7 +224,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -235,7 +235,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -246,7 +246,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -257,7 +257,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);

View File

@@ -12,7 +12,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <type_traits>
//
@@ -26,7 +26,7 @@ class D: public B
{
};
using boost::is_convertible;
using std::is_convertible;
#define TEST_CV_TRUE_( S1, T, S2, U ) \
BOOST_TEST(( is_convertible< S1<T>, S2<U> >::value == true )); \

View File

@@ -12,7 +12,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <type_traits>
//
@@ -26,7 +26,7 @@ class D: public B
{
};
using boost::is_convertible;
using std::is_convertible;
#define TEST_CV_TRUE_( S1, T, S2, U ) \
BOOST_TEST(( is_convertible< S1<T>, S2<U> >::value == true )); \

View File

@@ -8,9 +8,9 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/smart_ptr/make_local_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/align/is_aligned.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <type_traits>
class type {
public:
@@ -50,7 +50,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<int[3]> result =
@@ -58,7 +58,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<int[][2]> result =
@@ -66,7 +66,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<int[2][2]> result =
@@ -74,7 +74,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[]> result =
@@ -82,7 +82,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[3]> result =
@@ -90,7 +90,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[][2]> result =
@@ -98,7 +98,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<const int[2][2]> result =
@@ -106,7 +106,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::local_shared_ptr<type[]> result =
@@ -114,7 +114,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> other = result;
result.reset();
@@ -126,7 +126,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> other = result;
result.reset();
@@ -138,7 +138,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[][2]> other = result;
result.reset();
@@ -150,7 +150,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[2][2]> other = result;
result.reset();
@@ -162,7 +162,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[]> other = result;
result.reset();
@@ -174,7 +174,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[3]> other = result;
result.reset();
@@ -186,7 +186,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[][2]> other = result;
result.reset();
@@ -198,7 +198,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[2][2]> other = result;
result.reset();

View File

@@ -8,9 +8,9 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/smart_ptr/make_local_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/align/is_aligned.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
#include <type_traits>
class type {
public:
@@ -50,7 +50,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -61,7 +61,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -72,7 +72,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -84,7 +84,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -96,7 +96,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -107,7 +107,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -118,7 +118,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -130,7 +130,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -142,7 +142,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> w1 = result;
result.reset();
@@ -154,7 +154,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> w1 = result;
result.reset();
@@ -166,7 +166,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -177,7 +177,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -188,7 +188,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -199,7 +199,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -210,7 +210,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -221,7 +221,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.local_use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);

View File

@@ -9,7 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/lightweight_test.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <type_traits>
class type {
public:
@@ -49,7 +49,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<int[3]> result =
@@ -57,7 +57,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<int[][2]> result =
@@ -65,7 +65,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<int[2][2]> result =
@@ -73,7 +73,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[]> result =
@@ -81,7 +81,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[3]> result =
@@ -89,7 +89,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[][2]> result =
@@ -97,7 +97,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<const int[2][2]> result =
@@ -105,7 +105,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
}
{
boost::shared_ptr<type[]> result =
@@ -113,7 +113,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> other = result;
result.reset();
@@ -125,7 +125,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> other = result;
result.reset();
@@ -137,7 +137,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[][2]> other = result;
result.reset();
@@ -149,7 +149,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<type[2][2]> other = result;
result.reset();
@@ -161,7 +161,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[]> other = result;
result.reset();
@@ -173,7 +173,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<const type[3]> other = result;
result.reset();
@@ -185,7 +185,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[][2]> other = result;
result.reset();
@@ -197,7 +197,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
boost::weak_ptr<const type[2][2]> other = result;
result.reset();

View File

@@ -9,7 +9,7 @@ Distributed under the Boost Software License, Version 1.0.
#include <boost/core/lightweight_test.hpp>
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/smart_ptr/weak_ptr.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <type_traits>
class type {
public:
@@ -49,7 +49,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -60,7 +60,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -71,7 +71,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -83,7 +83,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -95,7 +95,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -106,7 +106,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0] == 0);
BOOST_TEST(result[1] == 0);
BOOST_TEST(result[2] == 0);
@@ -117,7 +117,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -129,7 +129,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<int>::value));
std::alignment_of<int>::value));
BOOST_TEST(result[0][0] == 0);
BOOST_TEST(result[0][1] == 0);
BOOST_TEST(result[1][0] == 0);
@@ -141,7 +141,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[]> w1 = result;
result.reset();
@@ -153,7 +153,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
boost::weak_ptr<type[3]> w1 = result;
result.reset();
@@ -165,7 +165,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -176,7 +176,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -187,7 +187,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -198,7 +198,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 3);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -209,7 +209,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);
@@ -220,7 +220,7 @@ int main()
BOOST_TEST(result.get() != 0);
BOOST_TEST(result.use_count() == 1);
BOOST_TEST(boost::alignment::is_aligned(result.get(),
boost::alignment_of<type>::value));
std::alignment_of<type>::value));
BOOST_TEST(type::instances == 4);
result.reset();
BOOST_TEST(type::instances == 0);

View File

@@ -12,9 +12,9 @@
#include <boost/enable_shared_from_this.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/move/unique_ptr.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <memory>
#include <utility>
#include <type_traits>
struct X: public boost::enable_shared_from_this< X >
{
@@ -88,7 +88,7 @@ template<class U, class T, class D> static void test_null_unique_ptr( boost::mov
BOOST_TEST( sp.get() == 0 );
BOOST_TEST( sp.use_count() == 0 );
sp.reset( new T, typename boost::remove_reference<D>::type() );
sp.reset( new T, typename std::remove_reference<D>::type() );
BOOST_TEST( sp.get() != 0 );
BOOST_TEST( sp.use_count() == 1 );

View File

@@ -11,7 +11,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <type_traits>
//
@@ -25,7 +25,7 @@ class D: public B
{
};
using boost::is_convertible;
using std::is_convertible;
#define TEST_CV_TRUE_( S1, T, S2, U ) \
BOOST_TEST(( is_convertible< S1<T>, S2<U> >::value == true )); \

View File

@@ -0,0 +1,27 @@
// Copyright 2024 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/core/lightweight_test_trait.hpp>
struct X;
int main()
{
using boost::detail::sp_is_bounded_array;
BOOST_TEST_TRAIT_FALSE(( sp_is_bounded_array<void> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_bounded_array<int> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_bounded_array<X> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_bounded_array<int[]> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_bounded_array<X[]> ));
BOOST_TEST_TRAIT_TRUE(( sp_is_bounded_array<int[1]> ));
BOOST_TEST_TRAIT_TRUE(( sp_is_bounded_array<int[7]> ));
BOOST_TEST_TRAIT_TRUE(( sp_is_bounded_array<X[1]> ));
BOOST_TEST_TRAIT_TRUE(( sp_is_bounded_array<X[7]> ));
return boost::report_errors();
}

View File

@@ -0,0 +1,27 @@
// Copyright 2024 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/core/lightweight_test_trait.hpp>
struct X;
int main()
{
using boost::detail::sp_is_unbounded_array;
BOOST_TEST_TRAIT_FALSE(( sp_is_unbounded_array<void> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_unbounded_array<int> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_unbounded_array<X> ));
BOOST_TEST_TRAIT_TRUE(( sp_is_unbounded_array<int[]> ));
BOOST_TEST_TRAIT_TRUE(( sp_is_unbounded_array<X[]> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_unbounded_array<int[1]> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_unbounded_array<int[7]> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_unbounded_array<X[1]> ));
BOOST_TEST_TRAIT_FALSE(( sp_is_unbounded_array<X[7]> ));
return boost::report_errors();
}

View File

@@ -0,0 +1,31 @@
// Copyright 2024 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/core/lightweight_test_trait.hpp>
struct X;
int main()
{
using boost::detail::sp_type_identity;
BOOST_TEST_TRAIT_SAME( sp_type_identity<void>::type, void );
BOOST_TEST_TRAIT_SAME( sp_type_identity<int>::type, int );
BOOST_TEST_TRAIT_SAME( sp_type_identity<X>::type, X );
BOOST_TEST_TRAIT_SAME( sp_type_identity<void const>::type, void const );
BOOST_TEST_TRAIT_SAME( sp_type_identity<int const>::type, int const );
BOOST_TEST_TRAIT_SAME( sp_type_identity<X const>::type, X const );
BOOST_TEST_TRAIT_SAME( sp_type_identity<void(int, X)>::type, void(int, X) );
BOOST_TEST_TRAIT_SAME( sp_type_identity<int[]>::type, int[] );
BOOST_TEST_TRAIT_SAME( sp_type_identity<X[]>::type, X[] );
BOOST_TEST_TRAIT_SAME( sp_type_identity<int[1]>::type, int[1] );
BOOST_TEST_TRAIT_SAME( sp_type_identity<X[2]>::type, X[2] );
return boost::report_errors();
}

View File

@@ -0,0 +1,18 @@
// Copyright 2024 Peter Dimov
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/smart_ptr/detail/sp_type_traits.hpp>
#include <boost/core/lightweight_test.hpp>
int main()
{
using boost::detail::sp_type_with_alignment;
BOOST_TEST_EQ( alignof( sp_type_with_alignment<1>::type ), 1 );
BOOST_TEST_EQ( alignof( sp_type_with_alignment<2>::type ), 2 );
BOOST_TEST_EQ( alignof( sp_type_with_alignment<4>::type ), 4 );
BOOST_TEST_EQ( alignof( sp_type_with_alignment<8>::type ), 8 );
return boost::report_errors();
}

View File

@@ -11,9 +11,9 @@
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <memory>
#include <utility>
#include <type_traits>
struct X: public boost::enable_shared_from_this< X >
{
@@ -87,7 +87,7 @@ template<class U, class T, class D> static void test_null_unique_ptr( std::uniqu
BOOST_TEST( sp.get() == 0 );
BOOST_TEST( sp.use_count() == 0 );
sp.reset( new T, typename boost::remove_reference<D>::type() );
sp.reset( new T, typename std::remove_reference<D>::type() );
BOOST_TEST( sp.get() != 0 );
BOOST_TEST( sp.use_count() == 1 );