diff --git a/sol/object.hpp b/sol/object.hpp index 9aee1b52..0889a37f 100644 --- a/sol/object.hpp +++ b/sol/object.hpp @@ -45,6 +45,10 @@ public: auto actual = lua_type(state(), -1); return (static_cast(expected) == actual) || (expected == type::poly); } + + explicit operator bool() const { + return is(); + } }; inline bool operator==(const object& lhs, const nil_t&) {