Add opening base lib in cxx-in-lua.rst

Loading `sol::lib::base` is needed since the corresponding lua file uses
`print` and `assert`.
This commit is contained in:
Hanjoung Lee 2019-03-06 00:07:01 +09:00 committed by The Phantom Derpstorm
parent 0c095d4090
commit 92f12952ef

View File

@ -98,6 +98,8 @@ To do this, you bind things using the ``new_usertype`` and ``set_usertype`` meth
int main () { int main () {
sol::state lua; sol::state lua;
lua.open_libraries(sol::lib::base);
// note that you can set a // note that you can set a
// userdata before you register a usertype, // userdata before you register a usertype,
// and it will still carry // and it will still carry