mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 04:52:59 +01:00
operator>> (object, std::vector<T>): return reference; don't copy
This commit is contained in:
parent
aaef612a05
commit
f7a9805f7b
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user