public:
T *get_object() { T *o = object; object = 0; return o; }
- void store_object(Collection &, const std::string &);
+ T *store_object(Collection &, const std::string &);
private:
void type(const Symbol &);
}
template<typename T, typename C>
-void DynamicObjectLoader<T, C>::store_object(Collection &c, const std::string &name)
+T *DynamicObjectLoader<T, C>::store_object(Collection &c, const std::string &name)
{
if(!store_func)
throw std::logic_error("no store function");
+ T *o = object;
store_func(c, name, object);
object = 0;
+ return o;
}
template<typename T, typename C>