From 02858580077f502d6d504bb275e9167b398c2dc9 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 5 Apr 2022 01:36:19 +0100 Subject: Fixup parameter forwarding --- slicer/db/sqlInsertSerializer.h | 9 +++++++-- slicer/db/testSelect.cpp | 2 +- slicer/slicer/slicer.h | 4 ++-- slicer/xml/testSpecifics.cpp | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/slicer/db/sqlInsertSerializer.h b/slicer/db/sqlInsertSerializer.h index 26989fc..b6a0d27 100644 --- a/slicer/db/sqlInsertSerializer.h +++ b/slicer/db/sqlInsertSerializer.h @@ -35,7 +35,10 @@ namespace Slicer { class DLL_PUBLIC SqlAutoIdInsertSerializer : public SqlInsertSerializer { public: - template explicit SqlAutoIdInsertSerializer(const P &... p) : SqlInsertSerializer(p...) { } + template + explicit SqlAutoIdInsertSerializer(P &&... p) : SqlInsertSerializer(std::forward

(p)...) + { + } protected: virtual void createInsertField(unsigned int & fieldNo, std::ostream & insert, const std::string & name, @@ -47,7 +50,9 @@ namespace Slicer { class DLL_PUBLIC SqlFetchIdInsertSerializer : public SqlAutoIdInsertSerializer { public: template - explicit SqlFetchIdInsertSerializer(const P &... p) : SqlAutoIdInsertSerializer(p...) { } + explicit SqlFetchIdInsertSerializer(P &&... p) : SqlAutoIdInsertSerializer(std::forward

(p)...) + { + } protected: virtual void bindObjectAndExecute(const Slicer::ModelPartPtr &, DB::ModifyCommand *) const override; diff --git a/slicer/db/testSelect.cpp b/slicer/db/testSelect.cpp index 9759233..769e31b 100644 --- a/slicer/db/testSelect.cpp +++ b/slicer/db/testSelect.cpp @@ -160,7 +160,7 @@ template T BoostThrowWrapperHelper(P &&... p) { - return Slicer::DeserializeAny(p...); + return Slicer::DeserializeAny(std::forward

(p)...); } BOOST_AUTO_TEST_CASE(select_unsupportedModel) diff --git a/slicer/slicer/slicer.h b/slicer/slicer/slicer.h index 4bf0681..ce7e037 100644 --- a/slicer/slicer/slicer.h +++ b/slicer/slicer/slicer.h @@ -19,7 +19,7 @@ namespace Slicer { Object DeserializeAny(SerializerParams &&... sp) { - return DeserializeAnyWith(std::make_shared(sp...)); + return DeserializeAnyWith(std::make_shared(std::forward(sp)...)); } template @@ -33,7 +33,7 @@ namespace Slicer { void SerializeAny(const Object & object, SerializerParams &&... sp) { - SerializeAnyWith(object, std::make_shared(sp...)); + SerializeAnyWith(object, std::make_shared(std::forward(sp)...)); } } diff --git a/slicer/xml/testSpecifics.cpp b/slicer/xml/testSpecifics.cpp index 93d19fe..e2d7691 100644 --- a/slicer/xml/testSpecifics.cpp +++ b/slicer/xml/testSpecifics.cpp @@ -23,7 +23,7 @@ template T BoostThrowWrapperHelper(P &&... p) { - return Slicer::DeserializeAny(p...); + return Slicer::DeserializeAny(std::forward

(p)...); } BOOST_AUTO_TEST_CASE(boolean_values) -- cgit v1.2.3