rewrite msgpack::object::via

This commit is contained in:
frsyuki
2009-02-15 18:39:30 +09:00
parent 6083300ea9
commit 761b398083
11 changed files with 165 additions and 133 deletions

View File

@@ -136,9 +136,9 @@ type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& operator>> (
object o,
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
if(o.type != type::ARRAY) { throw type_error(); }
if(o.via.container.size < <%=i+1%>) { throw type_error(); }
if(o.via.array.size < <%=i+1%>) { throw type_error(); }
<%0.upto(i) {|j|%>
o.via.container.ptr[<%=j%>].convert<A<%=j%>>(&v.template get<<%=j%>>());<%}%>
o.via.array.ptr[<%=j%>].convert<A<%=j%>>(&v.template get<<%=j%>>());<%}%>
return v;
}
<%}%>