diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-04-05 01:36:19 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-04-05 01:36:19 +0100 |
commit | 02858580077f502d6d504bb275e9167b398c2dc9 (patch) | |
tree | f7fab665e5d15c6ac50e420cf0f27dc84452298c | |
parent | Use stringstream str by move (diff) | |
download | slicer-02858580077f502d6d504bb275e9167b398c2dc9.tar.bz2 slicer-02858580077f502d6d504bb275e9167b398c2dc9.tar.xz slicer-02858580077f502d6d504bb275e9167b398c2dc9.zip |
Fixup parameter forwarding
-rw-r--r-- | slicer/db/sqlInsertSerializer.h | 9 | ||||
-rw-r--r-- | slicer/db/testSelect.cpp | 2 | ||||
-rw-r--r-- | slicer/slicer/slicer.h | 4 | ||||
-rw-r--r-- | 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<typename... P> explicit SqlAutoIdInsertSerializer(const P &... p) : SqlInsertSerializer(p...) { } + template<typename... P> + explicit SqlAutoIdInsertSerializer(P &&... p) : SqlInsertSerializer(std::forward<P>(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<typename... P> - explicit SqlFetchIdInsertSerializer(const P &... p) : SqlAutoIdInsertSerializer(p...) { } + explicit SqlFetchIdInsertSerializer(P &&... p) : SqlAutoIdInsertSerializer(std::forward<P>(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<typename T, typename... P> T BoostThrowWrapperHelper(P &&... p) { - return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, T>(p...); + return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, T>(std::forward<P>(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<Object>(std::make_shared<Deserializer>(sp...)); + return DeserializeAnyWith<Object>(std::make_shared<Deserializer>(std::forward<SerializerParams>(sp)...)); } template<typename Object> @@ -33,7 +33,7 @@ namespace Slicer { void SerializeAny(const Object & object, SerializerParams &&... sp) { - SerializeAnyWith(object, std::make_shared<Serializer>(sp...)); + SerializeAnyWith(object, std::make_shared<Serializer>(std::forward<SerializerParams>(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<typename T, typename... P> T BoostThrowWrapperHelper(P &&... p) { - return Slicer::DeserializeAny<Slicer::XmlDocumentDeserializer, T>(p...); + return Slicer::DeserializeAny<Slicer::XmlDocumentDeserializer, T>(std::forward<P>(p)...); } BOOST_AUTO_TEST_CASE(boolean_values) |