]> git.tdb.fi Git - libs/datafile.git/blobdiff - source/value.h
Cosmetic changes
[libs/datafile.git] / source / value.h
index e2b9fb1c569782fcbc96dc9d687d9b48eb83388d..bcddd6ed3aebb579256cd0a11061a76312a4a95c 100644 (file)
@@ -2,6 +2,7 @@
 #define MSP_DATAFILE_VALUE_H_
 
 #include <vector>
+#include <msp/core/attributes.h>
 #include <msp/core/meta.h>
 #include <msp/core/variant.h>
 #include "type.h"
@@ -17,12 +18,13 @@ private:
 
 public:
        template<typename T>
-       Value(T d):
+       Value(T &&d):
                sig(TypeInfo<T>::signature),
-               data(static_cast<typename TypeInfo<T>::Store>(d))
+               data(static_cast<typename TypeInfo<T>::Store>(std::forward<T>(d)))
        { }
 
-       Value(Symbol d): sig(TypeInfo<Symbol>::signature), data(d) { }
+       Value(const Symbol &d): sig(TypeInfo<Symbol>::signature), data(d) { }
+       Value(Symbol &&d): sig(TypeInfo<Symbol>::signature), data(std::move(d)) { }
 
        template<typename T>
        typename TypeInfo<T>::Load get() const
@@ -34,8 +36,6 @@ private:
        T get_() const;
 };
 
-typedef std::vector<Value> ValueArray __attribute__((deprecated));
-
 template<typename T>
 inline T Value::get_() const
 {