diff --git a/sol/function.hpp b/sol/function.hpp index 91da5d18..ba049746 100644 --- a/sol/function.hpp +++ b/sol/function.hpp @@ -25,6 +25,7 @@ #include "reference.hpp" #include "tuple.hpp" #include "stack.hpp" +#include namespace sol { class function : public reference { diff --git a/sol/object.hpp b/sol/object.hpp index 1c6f53d1..9aee1b52 100644 --- a/sol/object.hpp +++ b/sol/object.hpp @@ -47,19 +47,19 @@ public: } }; -bool operator==(const object& lhs, const nil_t&) { +inline bool operator==(const object& lhs, const nil_t&) { return lhs.is(); } -bool operator==(const nil_t&, const object& rhs) { +inline bool operator==(const nil_t&, const object& rhs) { return rhs.is(); } -bool operator!=(const object& lhs, const nil_t&) { +inline bool operator!=(const object& lhs, const nil_t&) { return !lhs.is(); } -bool operator!=(const nil_t&, const object& rhs) { +inline bool operator!=(const nil_t&, const object& rhs) { return !rhs.is(); } } // sol diff --git a/sol/stack.hpp b/sol/stack.hpp index 3baf02c5..e89a1c92 100644 --- a/sol/stack.hpp +++ b/sol/stack.hpp @@ -214,20 +214,20 @@ inline void push_tuple(lua_State* L, indices, T&& tuplen) { } template -auto ltr_pop(lua_State*, F&& f, types, types<>, Vs&&... vs) -> decltype(f(std::forward(vs)...)) { +inline auto ltr_pop(lua_State*, F&& f, types, types<>, Vs&&... vs) -> decltype(f(std::forward(vs)...)) { return f(std::forward(vs)...); } template -auto ltr_pop(lua_State* L, F&& f, types t, types, Vs&&... vs) -> decltype(f(std::declval()...)) { +inline auto ltr_pop(lua_State* L, F&& f, types t, types, Vs&&... vs) -> decltype(f(std::declval()...)) { return ltr_pop(L, std::forward(f), t, types(), std::forward(vs)..., pop(L)); } template -auto rtl_pop(lua_State*, F&& f, types, types<>, Vs&&... vs) -> decltype(f(std::forward(vs)...)) { +inline auto rtl_pop(lua_State*, F&& f, types, types<>, Vs&&... vs) -> decltype(f(std::forward(vs)...)) { return f(std::forward(vs)...); } template -auto rtl_pop(lua_State* L, F&& f, types t, types, Vs&&... vs) -> decltype(f(std::declval()...)) { +inline auto rtl_pop(lua_State* L, F&& f, types t, types, Vs&&... vs) -> decltype(f(std::declval()...)) { return rtl_pop(L, std::forward(f), t, types(), pop(L), std::forward(vs)...); } } // detail @@ -267,12 +267,12 @@ inline auto pop_reverse_call(lua_State* L, TFx&& fx, types t) -> declty return detail::rtl_pop(L, std::forward(fx), t, reversed()); } -void push_args(lua_State*) { +inline void push_args(lua_State*) { } template -void push_args(lua_State* L, Arg&& arg, Args&&... args) { +inline void push_args(lua_State* L, Arg&& arg, Args&&... args) { using swallow = char[]; stack::push(L, std::forward(arg)); void(swallow{'\0', (stack::push(L, std::forward(args)), '\0')... }); diff --git a/sol/state.hpp b/sol/state.hpp index eddac745..dea18762 100644 --- a/sol/state.hpp +++ b/sol/state.hpp @@ -34,7 +34,7 @@ struct are_same : std::true_type {}; template struct are_same : std::integral_constant::value && are_same::value> {}; -int atpanic(lua_State* L) { +inline int atpanic(lua_State* L) { std::string err = lua_tostring(L, -1); throw sol_error(err); }