author | Francesco Abbate <francesco.bbt@gmail.com> | 2011年12月18日 00:02:19 +0100 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2011年12月18日 00:02:19 +0100 |
commit | ee563973094a8235631d5208bd672f8cbbe15fdc (patch) | |
tree | 6a72a6e6ece3cb9a96fc221f3e04922e63f42f00 /agg-plot/lua-cpp-utils.h | |
parent | ef0f158b491b4211c392ce4c4c50891b6d5631de (diff) | |
download | gsl-shell-ee563973094a8235631d5208bd672f8cbbe15fdc.tar.gz |
-rw-r--r-- | agg-plot/lua-cpp-utils.h | 23 |
diff --git a/agg-plot/lua-cpp-utils.h b/agg-plot/lua-cpp-utils.h index b2d506a5..7111aa5f 100644 --- a/agg-plot/lua-cpp-utils.h +++ b/agg-plot/lua-cpp-utils.h @@ -1,7 +1,6 @@ #ifndef LUA_CPP_UTILS_H #define LUA_CPP_UTILS_H -#include <exception> #include <new> #include "defs.h" @@ -45,31 +44,13 @@ inline void* operator new(size_t nbytes, lua_State *L, enum gs_type_e tp) template <class T> T* push_new_object (lua_State *L, enum gs_type_e tp) { - try - { - return new(L, tp) T(); - } - catch (std::bad_alloc&) - { - luaL_error (L, "out of memory"); - } - - return 0; + return new(L, tp) T(); } template <class T, class init_type> T* push_new_object (lua_State *L, enum gs_type_e tp, init_type& init) { - try - { - return new(L, tp) T(init); - } - catch (std::bad_alloc&) - { - luaL_error (L, "out of memory"); - } - - return 0; + return new(L, tp) T(init); } template <class T> |