diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h index 66e8766297cd6f5593375bce05fa883891d0794b..bec3954769ff24b8f3936eefeb0138710ef68e80 100644 --- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h +++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.h @@ -228,9 +228,10 @@ public: /** * @brief Call the @c T constructor. * @param p Location of the memory. - * @param val Parameter to pass to the constructor. + * @param args Arguments to pass to the constructor. */ - void construct (pointer p, const T& val); + template <class... Args> + void construct (pointer p, Args&&... args); /** diff --git a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc index b9f346b5bcfad4c4d4eced5d5c9af478a7fde2f6..e1271cd79a151a9a400799705c818a0722664c19 100644 --- a/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc +++ b/Control/AthAllocators/AthAllocators/ArenaHeapSTLAllocator.icc @@ -269,13 +269,14 @@ ArenaHeapSTLAllocator<T, VETO>::max_size() const throw() /** * @brief Call the @c T constructor. * @param p Location of the memory. - * @param val Parameter to pass to the constructor. + * @param args Arguments to pass to the constructor. */ template <class T, class VETO> +template <class... Args> inline -void ArenaHeapSTLAllocator<T, VETO>::construct (pointer p, const T& val) +void ArenaHeapSTLAllocator<T, VETO>::construct (pointer p, Args&&... args) { - new (reinterpret_cast<void*>(p)) T(val); + new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...); } diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h index 082d34d0046cfaacce722c1cc168afd03964e416..0c9a21a9b6c9a23a03582033f95324a24544ebc7 100644 --- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h +++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.h @@ -243,9 +243,10 @@ public: /** * @brief Call the @c T constructor. * @param p Location of the memory. - * @param val Parameter to pass to the constructor. + * @param args Arguments to pass to the constructor. */ - void construct (pointer p, const T& val); + template <class... Args> + void construct (pointer p, Args&&... args); /** diff --git a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc index 5fb443f98fd3fcc0bc6d5208b60878b4c16e26af..2e3215521752af94e2e81d64f24f1e02b3a3079d 100644 --- a/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc +++ b/Control/AthAllocators/AthAllocators/ArenaPoolSTLAllocator.icc @@ -269,13 +269,14 @@ ArenaPoolSTLAllocator<T, VETO>::max_size() const throw() /** * @brief Call the @c T constructor. * @param p Location of the memory. - * @param val Parameter to pass to the constructor. + * @param args Arguments to pass to the constructor. */ template <class T, class VETO> +template <class... Args> inline -void ArenaPoolSTLAllocator<T, VETO>::construct (pointer p, const T& val) +void ArenaPoolSTLAllocator<T, VETO>::construct (pointer p, Args&&... args) { - new (reinterpret_cast<void*>(p)) T(val); + new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...); } diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h index def334eb7ebef83aeac45fe8df9c7ef65e5ffa6c..12a7e096566d1f76b84c662537d816745ea0cc66 100644 --- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h +++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.h @@ -345,9 +345,10 @@ public: /** * @brief Call the @c T constructor. * @param p Location of the memory. - * @param val Parameter to pass to the constructor. + * @param args Arguments to pass to the constructor. */ - void construct (pointer p, const T& val); + template <class... Args> + void construct (pointer p, Args&&... args); /** diff --git a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc index ef78c763db9a56b74cbedb1c0ea4a04a30cd3781..eed3dae4cd730b3be08c32f4bb4ccb6b0526cbbe 100644 --- a/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc +++ b/Control/AthAllocators/AthAllocators/ArenaSharedHeapSTLAllocator.icc @@ -340,13 +340,14 @@ ArenaSharedHeapSTLAllocator<T>::max_size() const throw() /** * @brief Call the @c T constructor. * @param p Location of the memory. - * @param val Parameter to pass to the constructor. + * @param args Arguments to pass to the constructor. */ template <class T> +template <class... Args> inline -void ArenaSharedHeapSTLAllocator<T>::construct (pointer p, const T& val) +void ArenaSharedHeapSTLAllocator<T>::construct (pointer p, Args&&... args) { - new (reinterpret_cast<void*>(p)) T(val); + new (reinterpret_cast<void*>(p)) T(std::forward<Args>(args)...); }