Minor cosmetic change in detail array_deleter

[SVN r81685]
This commit is contained in:
Glen Fernandes
2012-12-03 05:56:17 +00:00
parent 5e5ff387fa
commit 1adf546ddb

View File

@ -27,68 +27,68 @@ namespace boost {
destroy(size); destroy(size);
} }
void construct(T* memory) { void construct(T* memory) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < size; i++) {
try { try {
for (object = memory; i < size; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(); ::new(p1) T();
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS) #if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
template<typename... Args> template<typename... Args>
void construct(T* memory, Args&&... args) { void construct(T* memory, Args&&... args) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < size; i++) {
try { try {
for (object = memory; i < size; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(args...); ::new(p1) T(args...);
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
#endif #endif
void construct_list(T* memory, const T* list) { void construct_list(T* memory, const T* list) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < size; i++) {
try { try {
for (object = memory; i < size; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(list[i]); ::new(p1) T(list[i]);
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
void construct_list(T* memory, const T* list, std::size_t n) { void construct_list(T* memory, const T* list, std::size_t n) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < size; i++) {
try { try {
for (object = memory; i < size; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(list[i % n]); ::new(p1) T(list[i % n]);
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
void construct_noinit(T* memory) { void construct_noinit(T* memory) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < size; i++) {
try { try {
for (object = memory; i < size; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T; ::new(p1) T;
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
void operator()(const void*) { void operator()(const void*) {
destroy(size); destroy(size);
} }
@ -114,68 +114,68 @@ namespace boost {
destroy(N); destroy(N);
} }
void construct(T* memory) { void construct(T* memory) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < N; i++) {
try { try {
for (object = memory; i < N; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(); ::new(p1) T();
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
#if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS) #if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
template<typename... Args> template<typename... Args>
void construct(T* memory, Args&&... args) { void construct(T* memory, Args&&... args) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < N; i++) {
try { try {
for (object = memory; i < N; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(args...); ::new(p1) T(args...);
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
#endif #endif
void construct_list(T* memory, const T* list) { void construct_list(T* memory, const T* list) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < N; i++) {
try { try {
for (object = memory; i < N; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(list[i]); ::new(p1) T(list[i]);
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
void construct_list(T* memory, const T* list, std::size_t n) { void construct_list(T* memory, const T* list, std::size_t n) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < N; i++) {
try { try {
for (object = memory; i < N; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T(list[i % n]); ::new(p1) T(list[i % n]);
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
void construct_noinit(T* memory) { void construct_noinit(T* memory) {
object = memory; std::size_t i = 0;
for (std::size_t i = 0; i < N; i++) {
try { try {
for (object = memory; i < N; i++) {
void* p1 = memory + i; void* p1 = memory + i;
::new(p1) T; ::new(p1) T;
}
} catch (...) { } catch (...) {
destroy(i); destroy(i);
throw; throw;
} }
} }
}
void operator()(const void*) { void operator()(const void*) {
destroy(N); destroy(N);
} }