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_dictionary.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_dictionary.h') diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h index 5d333808b9..13cbdcf7ac 100644 --- a/core/fpdfapi/parser/cpdf_dictionary.h +++ b/core/fpdfapi/parser/cpdf_dictionary.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "core/fpdfapi/parser/cpdf_object.h" #include "core/fxcrt/cfx_string_pool_template.h" @@ -70,15 +71,16 @@ class CPDF_Dictionary : public CPDF_Object { template typename std::enable_if::value, T*>::type SetNewFor( const CFX_ByteString& key, - Args... args) { - return static_cast(SetFor(key, pdfium::MakeUnique(args...))); + Args&&... args) { + return static_cast( + SetFor(key, pdfium::MakeUnique(std::forward(args)...))); } template typename std::enable_if::value, T*>::type SetNewFor( const CFX_ByteString& key, - Args... args) { - return static_cast( - SetFor(key, pdfium::MakeUnique(m_pPool, args...))); + Args&&... args) { + return static_cast(SetFor( + key, pdfium::MakeUnique(m_pPool, std::forward(args)...))); } // Convenience functions to convert native objects to array form. -- cgit v1.2.3