X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvalue.h;h=ba6118181260c1c92c2a53f8f885507914a4d759;hb=refs%2Fheads%2Fwip;hp=e2b9fb1c569782fcbc96dc9d687d9b48eb83388d;hpb=818ead7b6ccef1e4d2435cc959bc07f910fcde46;p=libs%2Fdatafile.git diff --git a/source/value.h b/source/value.h index e2b9fb1..ba61181 100644 --- a/source/value.h +++ b/source/value.h @@ -2,6 +2,8 @@ #define MSP_DATAFILE_VALUE_H_ #include +#include +#include #include #include #include "type.h" @@ -17,12 +19,13 @@ private: public: template - Value(T d): + Value(T &&d, typename std::enable_if::type, Value>::value, int>::type = 0): sig(TypeInfo::signature), - data(static_cast::Store>(d)) + data(static_cast::Store>(std::forward(d))) { } - Value(Symbol d): sig(TypeInfo::signature), data(d) { } + Value(const Symbol &d): sig(TypeInfo::signature), data(d) { } + Value(Symbol &&d): sig(TypeInfo::signature), data(std::move(d)) { } template typename TypeInfo::Load get() const @@ -34,8 +37,6 @@ private: T get_() const; }; -typedef std::vector ValueArray __attribute__((deprecated)); - template inline T Value::get_() const {