mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-02-07 02:09:59 +00:00
MSVC2005 compatibility (@hotpepsi++)
This commit is contained in:
parent
34b3bbc883
commit
7df60b259b
5 changed files with 21 additions and 10 deletions
|
|
@ -29,11 +29,15 @@ inline std::vector<T>& operator>> (object o, std::vector<T>& v)
|
|||
{
|
||||
if(o.type != type::ARRAY) { throw type_error(); }
|
||||
v.resize(o.via.array.size);
|
||||
object* p = o.via.array.ptr;
|
||||
object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
T* it = &v.front();
|
||||
for(; p < pend; ++p, ++it) {
|
||||
p->convert(it);
|
||||
if(o.via.array.size > 0) {
|
||||
object* p = o.via.array.ptr;
|
||||
object* const pend = o.via.array.ptr + o.via.array.size;
|
||||
T* it = &v[0];
|
||||
do {
|
||||
p->convert(it);
|
||||
++p;
|
||||
++it;
|
||||
} while(p < pend);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue