mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Merge remote-tracking branch 'root/master'
This commit is contained in:
commit
a8e9c01d0d
|
@ -19,8 +19,8 @@
|
|||
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#ifndef SOL_LUA_FUNC_HPP
|
||||
#define SOL_LUA_FUNC_HPP
|
||||
#ifndef SOL_FUNCTION_TYPES_HPP
|
||||
#define SOL_FUNCTION_TYPES_HPP
|
||||
|
||||
#include "stack.hpp"
|
||||
#include <memory>
|
||||
|
@ -283,4 +283,4 @@ struct userdata_function : public base_function {
|
|||
|
||||
} // sol
|
||||
|
||||
#endif // SOL_LUA_FUNC_HPP
|
||||
#endif // SOL_FUNCTION_TYPES_HPP
|
||||
|
|
|
@ -46,6 +46,10 @@ public:
|
|||
auto actual = lua_type(state(), -1);
|
||||
return (static_cast<int>(expected) == actual) || (expected == type::poly);
|
||||
}
|
||||
|
||||
explicit operator bool() const {
|
||||
return is<nil_t>();
|
||||
}
|
||||
};
|
||||
|
||||
inline bool operator==(const object& lhs, const nil_t&) {
|
||||
|
|
|
@ -68,9 +68,9 @@ inline T& get(types<userdata<T>>, lua_State* L, int index = -1) {
|
|||
return *obj;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T get(types<T>, lua_State* L, int index = -1) {
|
||||
return T(L, index);
|
||||
template <typename T, typename U = typename std::remove_reference<T>::type>
|
||||
inline U get(types<T>, lua_State* L, int index = -1) {
|
||||
return U(L, index);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Reference in New Issue
Block a user