shared_ptr requires complete type; cannot use it with lua_State*
Posted
by topright
on Stack Overflow
See other posts from Stack Overflow
or by topright
Published on 2010-03-12T15:17:52Z
Indexed on
2010/03/12
15:57 UTC
Read the original article
Hit count: 317
Hello!
I'm writing a C++/OOP wrapper for Lua. My code is:
class LuaState
{
boost::shared_ptr<lua_State> L;
LuaState(): L( luaL_newstate(), LuaState::CustomDeleter )
{
}
}
The problem is lua_State is incomplete type and shared_ptr constructor requires complete type. And I need safe pointer sharing. (Funny thing boost docs say most functions do not require complete type, but constructor requires, so there is no way of using it. http://www.boost.org/doc/libs/1_42_0/libs/smart_ptr/smart_ptr.htm)
Can can I solve this? Thank you.
© Stack Overflow or respective owner