forked from boostorg/smart_ptr
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:
@ -37,8 +37,7 @@ namespace boost {
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline void array_construct(T* memory, std::size_t size, boost::true_type) {
|
inline void array_construct(T* memory, std::size_t size, boost::true_type) {
|
||||||
for (std::size_t i = 0; i < size; i++) {
|
for (std::size_t i = 0; i < size; i++) {
|
||||||
void* p1 = memory + i;
|
memory[i] = T();
|
||||||
::new(p1) T();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
Reference in New Issue
Block a user