From d8f710cedd62c1d28beee15d7dc3d31ddd148437 Mon Sep 17 00:00:00 2001 From: tsepez Date: Sun, 20 Nov 2016 01:00:29 -0800 Subject: Provide perfect-forwarding in CPDF_Object templates. We'll hit this issue when we try to make CPDF_stream ctors take other unique pointers, for example. Review-Url: https://codereview.chromium.org/2513613003 --- core/fpdfapi/parser/cpdf_indirect_object_holder.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_indirect_object_holder.h') 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 #include #include +#include #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 std::enable_if::value, T*>::type NewIndirect( - Args... args) { - return static_cast(AddIndirectObject(pdfium::MakeUnique(args...))); + Args&&... args) { + return static_cast( + AddIndirectObject(pdfium::MakeUnique(std::forward(args)...))); } template typename std::enable_if::value, T*>::type NewIndirect( - Args... args) { - return static_cast( - AddIndirectObject(pdfium::MakeUnique(m_pByteStringPool, args...))); + Args&&... args) { + return static_cast(AddIndirectObject( + pdfium::MakeUnique(m_pByteStringPool, std::forward(args)...))); } // Takes ownership of |pObj|, returns unowned pointer to it. -- cgit v1.2.3