operator>> (object, std::vector<T>): return reference; don't copy

This commit is contained in:
frsyuki 2009-08-06 13:26:34 +09:00
parent aaef612a05
commit f7a9805f7b

View File

@ -25,7 +25,7 @@ namespace msgpack {
template <typename T> template <typename T>
inline std::vector<T> operator>> (object o, std::vector<T>& v) inline std::vector<T>& operator>> (object o, std::vector<T>& v)
{ {
if(o.type != type::ARRAY) { throw type_error(); } if(o.type != type::ARRAY) { throw type_error(); }
v.resize(o.via.array.size); v.resize(o.via.array.size);