Prechádzať zdrojové kódy

Fix perfect fowards

Aaron Gokaslan 2 rokov pred
rodič
commit
97cb1c6b15

+ 6 - 6
code/AssetLib/FBX/FBXExportNode.h

@@ -85,24 +85,24 @@ public: // constructors
 
     // convenience template to construct with properties directly
     template <typename... More>
-    Node(const std::string& n, const More... more)
+    Node(const std::string& n, More&&... more)
     : name(n)
     , properties()
     , children()
     , force_has_children(false) {
-        AddProperties(more...);
+        AddProperties(std::forward<More>(more)...);
     }
 
 public: // functions to add properties or children
     // add a single property to the node
     template <typename T>
-    void AddProperty(T value) {
+    void AddProperty(T&& value) {
         properties.emplace_back(std::forward<T>(value));
     }
 
     // convenience function to add multiple properties at once
     template <typename T, typename... More>
-    void AddProperties(T value, More... more) {
+    void AddProperties(T&& value, More&&... more) {
         properties.emplace_back(std::forward<T>(value));
         AddProperties(std::forward<More>(more)...);
     }
@@ -115,7 +115,7 @@ public: // functions to add properties or children
     template <typename... More>
     void AddChild(
         const std::string& name,
-        More... more
+        More&&... more
     ) {
         FBX::Node c(name);
         c.AddProperties(std::forward<More>(more)...);
@@ -147,7 +147,7 @@ public: // support specifically for dealing with Properties70 nodes
         const std::string& type,
         const std::string& type2,
         const std::string& flags,
-        More... more
+        More&&... more
     ) {
         Node n("P");
         n.AddProperties(name, type, type2, flags, std::forward<More>(more)...);

+ 1 - 4
code/AssetLib/glTF/glTFCommon.h

@@ -245,12 +245,9 @@ struct Nullable {
 
     Nullable() :
             isPresent(false) {}
-    Nullable(const T &val) :
+    Nullable(T &val) :
             value(val),
             isPresent(true) {}
-	Nullable(T &&val) :
-			value(std::move(val)),
-			isPresent(true) {}
 };
 
 //! A reference to one top-level object, which is valid