update single

This commit is contained in:
ThePhD 2017-02-18 21:59:53 -05:00
parent a9cfe4b980
commit 295bc3a911

View File

@ -20,8 +20,8 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script. // This file was generated with a script.
// Generated 2017-02-17 10:46:09.695757 UTC // Generated 2017-02-19 02:59:41.608823 UTC
// This header was generated with sol v2.15.8 (revision 37420dc) // This header was generated with sol v2.15.8 (revision a9cfe4b)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP #ifndef SOL_SINGLE_INCLUDE_HPP
@ -8535,7 +8535,7 @@ namespace sol {
namespace sol { namespace sol {
namespace function_detail { namespace function_detail {
template <typename... Functions> template <int start_skew = 0, typename... Functions>
struct overloaded_function { struct overloaded_function {
typedef std::tuple<Functions...> overload_list; typedef std::tuple<Functions...> overload_list;
typedef std::make_index_sequence<sizeof...(Functions)> indices; typedef std::make_index_sequence<sizeof...(Functions)> indices;
@ -8557,7 +8557,7 @@ namespace sol {
int operator()(lua_State* L) { int operator()(lua_State* L) {
auto mfx = [&](auto&&... args) { return this->call(std::forward<decltype(args)>(args)...); }; auto mfx = [&](auto&&... args) { return this->call(std::forward<decltype(args)>(args)...); };
return call_detail::overload_match<Functions...>(mfx, L, 1); return call_detail::overload_match<Functions...>(mfx, L, 1 + start_skew);
} }
}; };
} // function_detail } // function_detail
@ -8718,6 +8718,8 @@ namespace sol {
namespace function_detail { namespace function_detail {
template<typename T> template<typename T>
struct class_indicator {}; struct class_indicator {};
struct call_indicator {};
} }
namespace stack { namespace stack {
template<typename... Sigs> template<typename... Sigs>
@ -8921,13 +8923,13 @@ namespace sol {
template<typename... Functions> template<typename... Functions>
struct pusher<overload_set<Functions...>> { struct pusher<overload_set<Functions...>> {
static int push(lua_State* L, overload_set<Functions...>&& set) { static int push(lua_State* L, overload_set<Functions...>&& set) {
typedef function_detail::overloaded_function<Functions...> F; typedef function_detail::overloaded_function<0, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, std::move(set.functions)); pusher<function_sig<>>{}.set_fx<F>(L, std::move(set.functions));
return 1; return 1;
} }
static int push(lua_State* L, const overload_set<Functions...>& set) { static int push(lua_State* L, const overload_set<Functions...>& set) {
typedef function_detail::overloaded_function<Functions...> F; typedef function_detail::overloaded_function<0, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, set.functions); pusher<function_sig<>>{}.set_fx<F>(L, set.functions);
return 1; return 1;
} }
@ -8991,16 +8993,28 @@ namespace sol {
template <typename... Functions> template <typename... Functions>
struct pusher<factory_wrapper<Functions...>> { struct pusher<factory_wrapper<Functions...>> {
static int push(lua_State* L, const factory_wrapper<Functions...>& fw) { static int push(lua_State* L, const factory_wrapper<Functions...>& fw) {
typedef function_detail::overloaded_function<Functions...> F; typedef function_detail::overloaded_function<0, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, fw.functions); pusher<function_sig<>>{}.set_fx<F>(L, fw.functions);
return 1; return 1;
} }
static int push(lua_State* L, factory_wrapper<Functions...>&& fw) { static int push(lua_State* L, factory_wrapper<Functions...>&& fw) {
typedef function_detail::overloaded_function<Functions...> F; typedef function_detail::overloaded_function<0, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, std::move(fw.functions)); pusher<function_sig<>>{}.set_fx<F>(L, std::move(fw.functions));
return 1; return 1;
} }
static int push(lua_State* L, const factory_wrapper<Functions...>& set, function_detail::call_indicator) {
typedef function_detail::overloaded_function<1, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, set.functions);
return 1;
}
static int push(lua_State* L, factory_wrapper<Functions...>&& set, function_detail::call_indicator) {
typedef function_detail::overloaded_function<1, Functions...> F;
pusher<function_sig<>>{}.set_fx<F>(L, std::move(set.functions));
return 1;
}
}; };
template <typename T, typename... Lists> template <typename T, typename... Lists>
@ -10825,19 +10839,31 @@ namespace sol {
hint->second = std::move(o); hint->second = std::move(o);
} }
template <typename N, typename F, typename... Args>
void insert_prepare(std::true_type, lua_State* L, N&& n, F&& f, Args&&... args) {
object o = make_object<F>(L, std::forward<F>(f), function_detail::call_indicator(), std::forward<Args>(args)...);
callconstructfunc = std::move(o);
}
template <typename N, typename F, typename... Args>
void insert_prepare(std::false_type, lua_State* L, N&& n, F&& f, Args&&... args) {
object o = make_object<F>(L, std::forward<F>(f), std::forward<Args>(args)...);
insert(std::forward<N>(n), std::move(o));
}
template <typename N, typename F> template <typename N, typename F>
void add_member_function(std::true_type, lua_State* L, N&& n, F&& f) { void add_member_function(std::true_type, lua_State* L, N&& n, F&& f) {
object o = make_object<F>(L, std::forward<F>(f), function_detail::class_indicator<T>()); insert_prepare(std::is_same<meta::unqualified_t<N>, call_construction>(), L, std::forward<N>(n), std::forward<F>(f), function_detail::class_indicator<T>());
if (std::is_same<meta::unqualified_t<N>, call_construction>::value) {
callconstructfunc = std::move(o);
return;
}
insert(std::forward<N>(n), std::move(o));
} }
template <typename N, typename F> template <typename N, typename F>
void add_member_function(std::false_type, lua_State* L, N&& n, F&& f) { void add_member_function(std::false_type, lua_State* L, N&& n, F&& f) {
object o = make_object<F>(L, std::forward<F>(f)); insert_prepare(std::is_same<meta::unqualified_t<N>, call_construction>(), L, std::forward<N>(n), std::forward<F>(f));
}
template <typename N, typename F, meta::enable<meta::is_callable<meta::unwrap_unqualified_t<F>>> = meta::enabler>
void add_function(lua_State* L, N&& n, F&& f) {
object o = make_object(L, as_function_reference(std::forward<F>(f)));
if (std::is_same<meta::unqualified_t<N>, call_construction>::value) { if (std::is_same<meta::unqualified_t<N>, call_construction>::value) {
callconstructfunc = std::move(o); callconstructfunc = std::move(o);
return; return;
@ -10845,11 +10871,6 @@ namespace sol {
insert(std::forward<N>(n), std::move(o)); insert(std::forward<N>(n), std::move(o));
} }
template <typename N, typename F, meta::enable<meta::is_callable<meta::unwrap_unqualified_t<F>>> = meta::enabler>
void add_function(lua_State* L, N&& n, F&& f) {
insert(std::forward<N>(n), make_object(L, as_function_reference(std::forward<F>(f))));
}
template <typename N, typename F, meta::disable<meta::is_callable<meta::unwrap_unqualified_t<F>>> = meta::enabler> template <typename N, typename F, meta::disable<meta::is_callable<meta::unwrap_unqualified_t<F>>> = meta::enabler>
void add_function(lua_State* L, N&& n, F&& f) { void add_function(lua_State* L, N&& n, F&& f) {
add_member_function(std::is_member_pointer<meta::unwrap_unqualified_t<F>>(), L, std::forward<N>(n), std::forward<F>(f)); add_member_function(std::is_member_pointer<meta::unwrap_unqualified_t<F>>(), L, std::forward<N>(n), std::forward<F>(f));