diff options
Diffstat (limited to 'core/fpdfapi/parser/cpdf_indirect_object_holder.h')
-rw-r--r-- | core/fpdfapi/parser/cpdf_indirect_object_holder.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/fpdfapi/parser/cpdf_indirect_object_holder.h b/core/fpdfapi/parser/cpdf_indirect_object_holder.h index a78e6663b3..1b174d8b62 100644 --- a/core/fpdfapi/parser/cpdf_indirect_object_holder.h +++ b/core/fpdfapi/parser/cpdf_indirect_object_holder.h @@ -10,6 +10,7 @@ #include <map> #include <memory> #include <type_traits> +#include <utility> #include "core/fpdfapi/parser/cpdf_object.h" #include "core/fxcrt/cfx_string_pool_template.h" @@ -34,14 +35,15 @@ class CPDF_IndirectObjectHolder { // handle objects that can intern strings from our ByteStringPool. template <typename T, typename... Args> typename std::enable_if<!CanInternStrings<T>::value, T*>::type NewIndirect( - Args... args) { - return static_cast<T*>(AddIndirectObject(pdfium::MakeUnique<T>(args...))); + Args&&... args) { + return static_cast<T*>( + AddIndirectObject(pdfium::MakeUnique<T>(std::forward<Args>(args)...))); } template <typename T, typename... Args> typename std::enable_if<CanInternStrings<T>::value, T*>::type NewIndirect( - Args... args) { - return static_cast<T*>( - AddIndirectObject(pdfium::MakeUnique<T>(m_pByteStringPool, args...))); + Args&&... args) { + return static_cast<T*>(AddIndirectObject( + pdfium::MakeUnique<T>(m_pByteStringPool, std::forward<Args>(args)...))); } // Takes ownership of |pObj|, returns unowned pointer to it. |