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