X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvalue.h;h=b7da1d7f3ff3668b0737f45440a19910076cda29;hb=HEAD;hp=78ec54a89b512599305316c9ff6ad0b35cb67b3e;hpb=67146b1b3bcb7d02307dcd4cc8b88cf778b41205;p=libs%2Fdatafile.git diff --git a/source/value.h b/source/value.h index 78ec54a..bcddd6e 100644 --- a/source/value.h +++ b/source/value.h @@ -2,6 +2,7 @@ #define MSP_DATAFILE_VALUE_H_ #include +#include #include #include #include "type.h" @@ -17,15 +18,16 @@ private: public: template - Value(T d): + Value(T &&d): 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 RemoveReference::Type get() const + typename TypeInfo::Load get() const { return get_::Store>(); } char get_signature() const { return sig; } @@ -34,8 +36,6 @@ private: T get_() const; }; -typedef std::vector ValueArray __attribute__((deprecated)); - template inline T Value::get_() const {