forked from boostorg/smart_ptr
Code consistency: Use the same style of #if conditional compilation checks in allocate_shared_array.hpp and make_shared_array.hpp.
[SVN r81643]
This commit is contained in:
@ -122,7 +122,7 @@ namespace boost {
|
||||
return boost::shared_ptr<T>(s1, p1);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
template<typename T, typename A>
|
||||
inline typename boost::detail::sp_if_size_array<T>::type
|
||||
allocate_shared(const A& allocator, const T& list) {
|
||||
|
@ -40,7 +40,6 @@ namespace boost {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
void construct_list(T* memory, std::size_t count, const T* list) {
|
||||
for (object = memory; size < count; size++) {
|
||||
void* p1 = object + size;
|
||||
@ -53,7 +52,6 @@ namespace boost {
|
||||
::new(p1) T(list[size % n]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
void construct_noinit(T* memory, std::size_t count) {
|
||||
for (object = memory; size < count; size++) {
|
||||
void* p1 = object + size;
|
||||
@ -98,7 +96,6 @@ namespace boost {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
void construct_list(T* memory, const T* list) {
|
||||
object = memory;
|
||||
for (std::size_t i = 0; i < N; i++) {
|
||||
@ -113,7 +110,6 @@ namespace boost {
|
||||
::new(p1) T(list[i % n]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
void construct_noinit(T* memory) {
|
||||
object = memory;
|
||||
for (std::size_t i = 0; i < N; i++) {
|
||||
|
@ -121,7 +121,7 @@ namespace boost {
|
||||
return boost::shared_ptr<T>(s1, p1);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
template<typename T>
|
||||
inline typename boost::detail::sp_if_size_array<T>::type
|
||||
make_shared(const T& list) {
|
||||
|
@ -63,7 +63,7 @@
|
||||
shared_ptr<T[][N]> <a href="#functions">allocate_shared</a>(const A& allocator, size_t size, initializer_list<T> list);
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
template<typename T, typename... Args>
|
||||
shared_ptr<T[N]> <a href="#functions">make_shared</a>(const T (&list)[N]);
|
||||
|
||||
|
@ -50,7 +50,7 @@ int main() {
|
||||
BOOST_TEST(a1[3].value == 3);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
{
|
||||
boost::shared_ptr<int[4]> a1 = boost::allocate_shared<int[4]>(std::allocator<int>(), { 0, 1, 2, 3 });
|
||||
BOOST_TEST(a1[0] == 0);
|
||||
|
@ -40,7 +40,7 @@ int main() {
|
||||
BOOST_TEST(a1[1][1][1] == 3);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
{
|
||||
boost::shared_ptr<int[4]> a1 = boost::allocate_shared<int[4]>(std::allocator<int>(), {0, 1, 2, 3});
|
||||
BOOST_TEST(a1[0] == 0);
|
||||
|
@ -50,7 +50,7 @@ int main() {
|
||||
BOOST_TEST(a1[3].value == 3);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
{
|
||||
boost::shared_ptr<int[4]> a1 = boost::make_shared<int[4]>({ 0, 1, 2, 3 });
|
||||
BOOST_TEST(a1[0] == 0);
|
||||
|
@ -41,7 +41,7 @@ int main() {
|
||||
BOOST_TEST(a1[1][1][1] == 3);
|
||||
}
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
|
||||
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
|
||||
{
|
||||
boost::shared_ptr<int[4]> a1 = boost::make_shared<int[4]>({0, 1, 2, 3});
|
||||
BOOST_TEST(a1[0] == 0);
|
||||
|
Reference in New Issue
Block a user