Skip to content

Commit 156a440

Browse files
committed
Merge pull request #239 from redboltz/add_msgpack_prefix_to_erb
Added msgpack prefix to erb template files.
2 parents 62be3f1 + ad5da7f commit 156a440

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

erb/cpp03_define.hpp.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct define<> {
9090
}
9191
void msgpack_unpack(msgpack::object const& o)
9292
{
93-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
93+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
9494
}
9595
void msgpack_object(msgpack::object* o, msgpack::zone&) const
9696
{
@@ -115,7 +115,7 @@ struct define<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> {
115115
}
116116
void msgpack_unpack(msgpack::object const& o)
117117
{
118-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
118+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
119119
const size_t size = o.via.array.size;
120120
if(size > 0) {
121121
msgpack::object *ptr = o.via.array.ptr;

erb/cpp03_msgpack_tuple.hpp.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,16 @@ inline tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>> make_tuple(typename tuple_type<
139139
inline msgpack::object const& operator>> (
140140
msgpack::object const& o,
141141
type::tuple<>&) {
142-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
142+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
143143
return o;
144144
}
145145
<%0.upto(GENERATION_LIMIT) {|i|%>
146146
template <typename A0<%1.upto(i) {|j|%>, typename A<%=j%><%}%>>
147147
inline msgpack::object const& operator>> (
148148
msgpack::object const& o,
149149
type::tuple<A0<%1.upto(i) {|j|%>, A<%=j%><%}%>>& v) {
150-
if(o.type != msgpack::type::ARRAY) { throw type_error(); }
151-
if(o.via.array.size < <%=i+1%>) { throw type_error(); }
150+
if(o.type != msgpack::type::ARRAY) { throw msgpack::type_error(); }
151+
if(o.via.array.size < <%=i+1%>) { throw msgpack::type_error(); }
152152
<%0.upto(i) {|j|%>
153153
o.via.array.ptr[<%=j%>].convert<typename type::tuple_type<A<%=j%>>::type>(v.template get<<%=j%>>());<%}%>
154154
return o;

0 commit comments

Comments
 (0)