ext/numo/narray/gen/tmpl/cast.c in numo-narray-0.9.0.3 vs ext/numo/narray/gen/tmpl/cast.c in numo-narray-0.9.0.4
- old
+ new
@@ -30,8 +30,12 @@
<%=find_tmpl("allocate").c_func%>(v);
<%=find_tmpl("store").c_func%>(v,obj);
}
return v;
}
+ <% if is_object %>
+ return numo_robject_new_dim0(obj);
+ <% else %>
rb_raise(nary_eCastError,"cannot cast to %s",rb_class2name(type));
return Qnil;
+ <% end %>
}