Optimization in initialization overload of array_construct for compilers to optimize it into the equivalent of a memset

[SVN r81750]
This commit is contained in:
Glen Fernandes
2012-12-07 06:45:26 +00:00
parent b3f2ebedbc
commit 09e77bc8df

View File

@ -37,8 +37,7 @@ namespace boost {
template<typename T>
inline void array_construct(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();
memory[i] = T();
}
}
template<typename T>