mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-08-01 21:54:28 +02:00
Correctly use r-value reference semantics for Args and T in array utilities
[SVN r81752]
This commit is contained in:
@@ -34,13 +34,13 @@ namespace boost {
|
||||
}
|
||||
#if defined(BOOST_HAS_RVALUE_REFS)
|
||||
void construct(T* memory, T&& value) {
|
||||
array_construct(memory, size, value);
|
||||
array_construct_value(memory, size, sp_forward<T>(value));
|
||||
object = memory;
|
||||
}
|
||||
#if defined(BOOST_HAS_VARIADIC_TMPL)
|
||||
template<typename... Args>
|
||||
void construct(T* memory, Args&&... args) {
|
||||
array_construct(memory, size, args...);
|
||||
array_construct_args(memory, size, sp_forward<Args>(args)...);
|
||||
object = memory;
|
||||
}
|
||||
#endif
|
||||
@@ -84,13 +84,13 @@ namespace boost {
|
||||
}
|
||||
#if defined(BOOST_HAS_RVALUE_REFS)
|
||||
void construct(T* memory, T&& value) {
|
||||
array_construct(memory, N, value);
|
||||
array_construct_value(memory, N, sp_forward<T>(value));
|
||||
object = memory;
|
||||
}
|
||||
#if defined(BOOST_HAS_VARIADIC_TMPL)
|
||||
template<typename... Args>
|
||||
void construct(T* memory, Args&&... args) {
|
||||
array_construct(memory, N, args...);
|
||||
array_construct_args(memory, N, sp_forward<Args>(args)...);
|
||||
object = memory;
|
||||
}
|
||||
#endif
|
||||
|
@@ -55,7 +55,7 @@ namespace boost {
|
||||
}
|
||||
#if defined(BOOST_HAS_RVALUE_REFS)
|
||||
template<typename T>
|
||||
inline void array_construct(T* memory, std::size_t size, T value) {
|
||||
inline void array_construct_value(T* memory, std::size_t size, T&& value) {
|
||||
std::size_t i = 0;
|
||||
try {
|
||||
for (; i < size; i++) {
|
||||
@@ -69,7 +69,7 @@ namespace boost {
|
||||
}
|
||||
#if defined(BOOST_HAS_VARIADIC_TMPL)
|
||||
template<typename T, typename... Args>
|
||||
inline void array_construct(T* memory, std::size_t size, Args... args) {
|
||||
inline void array_construct_args(T* memory, std::size_t size, Args&&... args) {
|
||||
std::size_t i = 0;
|
||||
try {
|
||||
for (; i < size; i++) {
|
||||
|
Reference in New Issue
Block a user