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:
Glen Fernandes
2012-12-01 05:40:06 +00:00
parent 8597433028
commit f5adfb0963
8 changed files with 7 additions and 11 deletions

View File

@ -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) {

View File

@ -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++) {

View File

@ -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) {

View File

@ -63,7 +63,7 @@
shared_ptr&lt;T[][N]&gt; <a href="#functions">allocate_shared</a>(const A&amp; allocator, size_t size, initializer_list&lt;T&gt; list);
#endif
#ifndef BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX)
template&lt;typename T, typename... Args&gt;
shared_ptr&lt;T[N]&gt; <a href="#functions">make_shared</a>(const T (&amp;list)[N]);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);