no-tests commit #2

tagged things wooOooOooo
This commit is contained in:
ThePhD 2019-04-28 16:45:40 -04:00
parent 3426947340
commit 67231f707f
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA
8 changed files with 225 additions and 80 deletions

View File

@ -25,6 +25,7 @@
#define SOL_FILTERS_HPP #define SOL_FILTERS_HPP
#include "traits.hpp" #include "traits.hpp"
#include <array> #include <array>
namespace sol { namespace sol {
@ -86,6 +87,14 @@ namespace sol {
auto filters(F&& f, Args&&... args) { auto filters(F&& f, Args&&... args) {
return filter_wrapper<std::decay_t<F>, std::decay_t<Args>...>(std::forward<F>(f), std::forward<Args>(args)...); return filter_wrapper<std::decay_t<F>, std::decay_t<Args>...>(std::forward<F>(f), std::forward<Args>(args)...);
} }
namespace detail {
template <typename T>
using is_filter = meta::is_specialization_of<T, filter_wrapper>;
template <typename T>
inline constexpr bool is_filter_v = is_filter<T>::value;
}
} // namespace sol } // namespace sol
#endif // SOL_FILTERS_HPP #endif // SOL_FILTERS_HPP

View File

@ -370,13 +370,13 @@ namespace sol {
struct unqualified_pusher<property_wrapper<F, G>> { struct unqualified_pusher<property_wrapper<F, G>> {
static int push(lua_State* L, property_wrapper<F, G>&& pw) { static int push(lua_State* L, property_wrapper<F, G>&& pw) {
if constexpr (std::is_void_v<F>) { if constexpr (std::is_void_v<F>) {
return stack::push(L, std::move(pw.write)); return stack::push(L, std::move(pw.write()));
} }
else if constexpr (std::is_void_v<G>) { else if constexpr (std::is_void_v<G>) {
return stack::push(L, std::move(pw.read)); return stack::push(L, std::move(pw.read()));
} }
else { else {
return stack::push(L, overload(std::move(pw.read), std::move(pw.write))); return stack::push(L, overload(std::move(pw.read()), std::move(pw.write())));
} }
} }
@ -396,10 +396,10 @@ namespace sol {
template <typename T> template <typename T>
struct unqualified_pusher<var_wrapper<T>> { struct unqualified_pusher<var_wrapper<T>> {
static int push(lua_State* L, var_wrapper<T>&& vw) { static int push(lua_State* L, var_wrapper<T>&& vw) {
return stack::push(L, std::move(vw.value)); return stack::push(L, std::move(vw.value()));
} }
static int push(lua_State* L, const var_wrapper<T>& vw) { static int push(lua_State* L, const var_wrapper<T>& vw) {
return stack::push(L, vw.value); return stack::push(L, vw.value());
} }
}; };
@ -442,6 +442,18 @@ namespace sol {
} }
}; };
template <typename T>
struct unqualified_pusher<detail::tagged<T, no_construction>> {
static int push(lua_State* L, no_construction) {
lua_CFunction cf = &function_detail::no_construction_error;
return stack::push(L, cf);
}
static int push(lua_State* L, no_construction c, function_detail::call_indicator) {
return push(L, c);
}
};
template <typename T, typename... Lists> template <typename T, typename... Lists>
struct unqualified_pusher<detail::tagged<T, constructor_list<Lists...>>> { struct unqualified_pusher<detail::tagged<T, constructor_list<Lists...>>> {
static int push(lua_State* L, detail::tagged<T, constructor_list<Lists...>>) { static int push(lua_State* L, detail::tagged<T, constructor_list<Lists...>>) {
@ -466,23 +478,43 @@ namespace sol {
template <typename T, typename... Fxs> template <typename T, typename... Fxs>
struct unqualified_pusher<detail::tagged<T, constructor_wrapper<Fxs...>>> { struct unqualified_pusher<detail::tagged<T, constructor_wrapper<Fxs...>>> {
template <typename C> static int push(lua_State* L, detail::tagged<T, constructor_wrapper<Fxs...>>&& c) {
static int push(lua_State* L, C&& c) { return push(L, std::move(c.value()));
}
static int push(lua_State* L, const detail::tagged<T, const constructor_wrapper<Fxs...>>& c) {
return push(L, c.value());
}
static int push(lua_State* L, constructor_wrapper<Fxs...>&& c) {
lua_CFunction cf = call_detail::call_user<T, false, false, constructor_wrapper<Fxs...>, 2>; lua_CFunction cf = call_detail::call_user<T, false, false, constructor_wrapper<Fxs...>, 2>;
int upvalues = 0; int upvalues = 0;
upvalues += stack::push(L, nullptr); upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<constructor_wrapper<Fxs...>>>(L, std::forward<C>(c)); upvalues += stack::push<user<constructor_wrapper<Fxs...>>>(L, std::move(c));
return stack::push(L, c_closure(cf, upvalues));
}
static int push(lua_State* L, const constructor_wrapper<Fxs...>& c) {
lua_CFunction cf = call_detail::call_user<T, false, false, constructor_wrapper<Fxs...>, 2>;
int upvalues = 0;
upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<constructor_wrapper<Fxs...>>>(L, c);
return stack::push(L, c_closure(cf, upvalues)); return stack::push(L, c_closure(cf, upvalues));
} }
}; };
template <typename F, typename... Fxs> template <typename F, typename... Fxs>
struct unqualified_pusher<constructor_wrapper<F, Fxs...>> { struct unqualified_pusher<constructor_wrapper<F, Fxs...>> {
template <typename C> static int push(lua_State* L, const constructor_wrapper<F, Fxs...>& c) {
static int push(lua_State* L, C&& c) {
typedef typename meta::bind_traits<F>::template arg_at<0> arg0; typedef typename meta::bind_traits<F>::template arg_at<0> arg0;
typedef meta::unqualified_t<std::remove_pointer_t<arg0>> T; typedef meta::unqualified_t<std::remove_pointer_t<arg0>> T;
return stack::push<detail::tagged<T, constructor_wrapper<F, Fxs...>>>(L, std::forward<C>(c)); return stack::push<detail::tagged<T, constructor_wrapper<F, Fxs...>>>(L, c);
}
static int push(lua_State* L, constructor_wrapper<F, Fxs...>&& c) {
typedef typename meta::bind_traits<F>::template arg_at<0> arg0;
typedef meta::unqualified_t<std::remove_pointer_t<arg0>> T;
return stack::push<detail::tagged<T, constructor_wrapper<F, Fxs...>>>(L, std::move(c));
} }
}; };
@ -553,6 +585,28 @@ namespace sol {
} }
}; };
template <typename T, typename F, typename... Filters>
struct unqualified_pusher<detail::tagged<T, filter_wrapper<F, Filters...>>> {
using P = filter_wrapper<F, Filters...>;
using Tagged = detail::tagged<T, P>;
static int push(lua_State* L, const Tagged& p) {
lua_CFunction cf = call_detail::call_user<T, false, false, P, 2>;
int upvalues = 0;
upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<P>>(L, p.value());
return stack::push(L, c_closure(cf, upvalues));
}
static int push(lua_State* L, Tagged&& p) {
lua_CFunction cf = call_detail::call_user<T, false, false, P, 2>;
int upvalues = 0;
upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<P>>(L, std::move(p.value()));
return stack::push(L, c_closure(cf, upvalues));
}
};
template <typename T> template <typename T>
struct unqualified_pusher<push_invoke_t<T>> { struct unqualified_pusher<push_invoke_t<T>> {
static int push(lua_State* L, push_invoke_t<T>&& pi) { static int push(lua_State* L, push_invoke_t<T>&& pi) {

View File

@ -78,10 +78,25 @@ namespace sol {
template <typename Tag, typename T> template <typename Tag, typename T>
struct tagged { struct tagged {
T value; private:
T value_;
public:
template <typename Arg, typename... Args, meta::disable<std::is_same<meta::unqualified_t<Arg>, tagged>> = meta::enabler> template <typename Arg, typename... Args, meta::disable<std::is_same<meta::unqualified_t<Arg>, tagged>> = meta::enabler>
tagged(Arg&& arg, Args&&... args) tagged(Arg&& arg, Args&&... args)
: value(std::forward<Arg>(arg), std::forward<Args>(args)...) { : value_(std::forward<Arg>(arg), std::forward<Args>(args)...) {
}
T& value() & {
return value_;
}
T const& value() const& {
return value_;
}
T&& value() && {
return std::move(value_);
} }
}; };
} // namespace detail } // namespace detail

View File

@ -29,7 +29,9 @@
#include "environment.hpp" #include "environment.hpp"
#include "load_result.hpp" #include "load_result.hpp"
#include "state_handling.hpp" #include "state_handling.hpp"
#include <memory> #include <memory>
#include <cstddef>
namespace sol { namespace sol {

View File

@ -1290,6 +1290,9 @@ namespace sol {
template <> template <>
struct is_non_factory_constructor<no_construction> : std::true_type {}; struct is_non_factory_constructor<no_construction> : std::true_type {};
template <typename T>
inline constexpr bool is_non_factory_constructor_v = is_non_factory_constructor<T>::value;
template <typename T> template <typename T>
struct is_constructor : is_non_factory_constructor<T> {}; struct is_constructor : is_non_factory_constructor<T> {};
@ -1302,6 +1305,9 @@ namespace sol {
template <typename F, typename... Filters> template <typename F, typename... Filters>
struct is_constructor<filter_wrapper<F, Filters...>> : is_constructor<meta::unqualified_t<F>> {}; struct is_constructor<filter_wrapper<F, Filters...>> : is_constructor<meta::unqualified_t<F>> {};
template <typename T>
inline constexpr bool is_constructor_v = is_constructor<T>::value;
template <typename... Args> template <typename... Args>
using any_is_constructor = meta::any<is_constructor<meta::unqualified_t<Args>>...>; using any_is_constructor = meta::any<is_constructor<meta::unqualified_t<Args>>...>;
@ -1319,11 +1325,6 @@ namespace sol {
template <typename... Args> template <typename... Args>
inline constexpr bool any_is_destructor_v = any_is_destructor<Args...>::value; inline constexpr bool any_is_destructor_v = any_is_destructor<Args...>::value;
struct add_destructor_tag {};
struct check_destructor_tag {};
struct verified_tag {
} const verified{};
} // namespace detail } // namespace detail
template <typename T> template <typename T>

View File

@ -45,25 +45,10 @@ namespace sol {
friend class basic_table_core; friend class basic_table_core;
template <std::size_t... I, typename... Args> template <std::size_t... I, typename... Args>
void tuple_set(std::index_sequence<I...> indices, std::tuple<Args...>&& args) { void tuple_set(std::index_sequence<I...>, std::tuple<Args...>&& args) {
using args_tuple = std::tuple<Args...>&&;
lua_State* L = this->lua_state();
optional<u_detail::usertype_storage<T>&> maybe_uts = u_detail::maybe_get_usertype_storage<T>(L);
if constexpr (sizeof...(I) > 0) {
if (maybe_uts) {
u_detail::usertype_storage<T>& uts = *maybe_uts;
(void)detail::swallow{ 0,
(uts.set(L, std::get<I * 2>(std::forward<args_tuple>(args)), std::get<I * 2 + 1>(std::forward<args_tuple>(args))),
0)... };
}
else {
table_base_t::template tuple_set<false>(indices, std::move(args));
}
}
else {
(void)indices;
(void)args; (void)args;
} (void)detail::swallow{ 0,
(this->set(std::get<I * 2>(std::move(args)), std::get<I * 2 + 1>(std::move(args))), 0)... };
} }
public: public:
@ -86,7 +71,15 @@ namespace sol {
uts.set(this->lua_state(), std::forward<Key>(key), std::forward<Value>(value)); uts.set(this->lua_state(), std::forward<Key>(key), std::forward<Value>(value));
} }
else { else {
base_t::set(std::forward<Key>(key), std::forward<Value>(value)); using ValueU = meta::unqualified_t<Value>;
// cannot get metatable: try regular table set?
if constexpr (detail::is_non_factory_constructor_v<ValueU> || detail::is_filter_v<ValueU>) {
// tag constructors so we don't get destroyed by lack of info
table_base_t::set(std::forward<Key>(key), detail::tagged<T, Value>(std::forward<Value>(value)));
}
else {
table_base_t::set(std::forward<Key>(key), std::forward<Value>(value));
}
} }
} }

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 2019-04-28 13:40:08.826493 UTC // Generated 2019-04-28 20:45:14.775010 UTC
// This header was generated with sol v3.0.1-beta2 (revision 2d47085) // This header was generated with sol v3.0.1-beta2 (revision 3426947)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP

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 2019-04-28 13:40:08.534101 UTC // Generated 2019-04-28 20:45:14.470847 UTC
// This header was generated with sol v3.0.1-beta2 (revision 2d47085) // This header was generated with sol v3.0.1-beta2 (revision 3426947)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP #ifndef SOL_SINGLE_INCLUDE_HPP
@ -5900,10 +5900,25 @@ namespace sol {
template <typename Tag, typename T> template <typename Tag, typename T>
struct tagged { struct tagged {
T value; private:
T value_;
public:
template <typename Arg, typename... Args, meta::disable<std::is_same<meta::unqualified_t<Arg>, tagged>> = meta::enabler> template <typename Arg, typename... Args, meta::disable<std::is_same<meta::unqualified_t<Arg>, tagged>> = meta::enabler>
tagged(Arg&& arg, Args&&... args) tagged(Arg&& arg, Args&&... args)
: value(std::forward<Arg>(arg), std::forward<Args>(args)...) { : value_(std::forward<Arg>(arg), std::forward<Args>(args)...) {
}
T& value() & {
return value_;
}
T const& value() const& {
return value_;
}
T&& value() && {
return std::move(value_);
} }
}; };
} // namespace detail } // namespace detail
@ -6033,6 +6048,14 @@ namespace sol {
auto filters(F&& f, Args&&... args) { auto filters(F&& f, Args&&... args) {
return filter_wrapper<std::decay_t<F>, std::decay_t<Args>...>(std::forward<F>(f), std::forward<Args>(args)...); return filter_wrapper<std::decay_t<F>, std::decay_t<Args>...>(std::forward<F>(f), std::forward<Args>(args)...);
} }
namespace detail {
template <typename T>
using is_filter = meta::is_specialization_of<T, filter_wrapper>;
template <typename T>
inline constexpr bool is_filter_v = is_filter<T>::value;
}
} // namespace sol } // namespace sol
// end of sol/filters.hpp // end of sol/filters.hpp
@ -7420,6 +7443,9 @@ namespace sol {
template <> template <>
struct is_non_factory_constructor<no_construction> : std::true_type {}; struct is_non_factory_constructor<no_construction> : std::true_type {};
template <typename T>
inline constexpr bool is_non_factory_constructor_v = is_non_factory_constructor<T>::value;
template <typename T> template <typename T>
struct is_constructor : is_non_factory_constructor<T> {}; struct is_constructor : is_non_factory_constructor<T> {};
@ -7432,6 +7458,9 @@ namespace sol {
template <typename F, typename... Filters> template <typename F, typename... Filters>
struct is_constructor<filter_wrapper<F, Filters...>> : is_constructor<meta::unqualified_t<F>> {}; struct is_constructor<filter_wrapper<F, Filters...>> : is_constructor<meta::unqualified_t<F>> {};
template <typename T>
inline constexpr bool is_constructor_v = is_constructor<T>::value;
template <typename... Args> template <typename... Args>
using any_is_constructor = meta::any<is_constructor<meta::unqualified_t<Args>>...>; using any_is_constructor = meta::any<is_constructor<meta::unqualified_t<Args>>...>;
@ -7449,11 +7478,6 @@ namespace sol {
template <typename... Args> template <typename... Args>
inline constexpr bool any_is_destructor_v = any_is_destructor<Args...>::value; inline constexpr bool any_is_destructor_v = any_is_destructor<Args...>::value;
struct add_destructor_tag {};
struct check_destructor_tag {};
struct verified_tag {
} const verified{};
} // namespace detail } // namespace detail
template <typename T> template <typename T>
@ -17636,13 +17660,13 @@ namespace sol {
struct unqualified_pusher<property_wrapper<F, G>> { struct unqualified_pusher<property_wrapper<F, G>> {
static int push(lua_State* L, property_wrapper<F, G>&& pw) { static int push(lua_State* L, property_wrapper<F, G>&& pw) {
if constexpr (std::is_void_v<F>) { if constexpr (std::is_void_v<F>) {
return stack::push(L, std::move(pw.write)); return stack::push(L, std::move(pw.write()));
} }
else if constexpr (std::is_void_v<G>) { else if constexpr (std::is_void_v<G>) {
return stack::push(L, std::move(pw.read)); return stack::push(L, std::move(pw.read()));
} }
else { else {
return stack::push(L, overload(std::move(pw.read), std::move(pw.write))); return stack::push(L, overload(std::move(pw.read()), std::move(pw.write())));
} }
} }
@ -17662,10 +17686,10 @@ namespace sol {
template <typename T> template <typename T>
struct unqualified_pusher<var_wrapper<T>> { struct unqualified_pusher<var_wrapper<T>> {
static int push(lua_State* L, var_wrapper<T>&& vw) { static int push(lua_State* L, var_wrapper<T>&& vw) {
return stack::push(L, std::move(vw.value)); return stack::push(L, std::move(vw.value()));
} }
static int push(lua_State* L, const var_wrapper<T>& vw) { static int push(lua_State* L, const var_wrapper<T>& vw) {
return stack::push(L, vw.value); return stack::push(L, vw.value());
} }
}; };
@ -17708,6 +17732,18 @@ namespace sol {
} }
}; };
template <typename T>
struct unqualified_pusher<detail::tagged<T, no_construction>> {
static int push(lua_State* L, no_construction) {
lua_CFunction cf = &function_detail::no_construction_error;
return stack::push(L, cf);
}
static int push(lua_State* L, no_construction c, function_detail::call_indicator) {
return push(L, c);
}
};
template <typename T, typename... Lists> template <typename T, typename... Lists>
struct unqualified_pusher<detail::tagged<T, constructor_list<Lists...>>> { struct unqualified_pusher<detail::tagged<T, constructor_list<Lists...>>> {
static int push(lua_State* L, detail::tagged<T, constructor_list<Lists...>>) { static int push(lua_State* L, detail::tagged<T, constructor_list<Lists...>>) {
@ -17732,23 +17768,43 @@ namespace sol {
template <typename T, typename... Fxs> template <typename T, typename... Fxs>
struct unqualified_pusher<detail::tagged<T, constructor_wrapper<Fxs...>>> { struct unqualified_pusher<detail::tagged<T, constructor_wrapper<Fxs...>>> {
template <typename C> static int push(lua_State* L, detail::tagged<T, constructor_wrapper<Fxs...>>&& c) {
static int push(lua_State* L, C&& c) { return push(L, std::move(c.value()));
}
static int push(lua_State* L, const detail::tagged<T, const constructor_wrapper<Fxs...>>& c) {
return push(L, c.value());
}
static int push(lua_State* L, constructor_wrapper<Fxs...>&& c) {
lua_CFunction cf = call_detail::call_user<T, false, false, constructor_wrapper<Fxs...>, 2>; lua_CFunction cf = call_detail::call_user<T, false, false, constructor_wrapper<Fxs...>, 2>;
int upvalues = 0; int upvalues = 0;
upvalues += stack::push(L, nullptr); upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<constructor_wrapper<Fxs...>>>(L, std::forward<C>(c)); upvalues += stack::push<user<constructor_wrapper<Fxs...>>>(L, std::move(c));
return stack::push(L, c_closure(cf, upvalues));
}
static int push(lua_State* L, const constructor_wrapper<Fxs...>& c) {
lua_CFunction cf = call_detail::call_user<T, false, false, constructor_wrapper<Fxs...>, 2>;
int upvalues = 0;
upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<constructor_wrapper<Fxs...>>>(L, c);
return stack::push(L, c_closure(cf, upvalues)); return stack::push(L, c_closure(cf, upvalues));
} }
}; };
template <typename F, typename... Fxs> template <typename F, typename... Fxs>
struct unqualified_pusher<constructor_wrapper<F, Fxs...>> { struct unqualified_pusher<constructor_wrapper<F, Fxs...>> {
template <typename C> static int push(lua_State* L, const constructor_wrapper<F, Fxs...>& c) {
static int push(lua_State* L, C&& c) {
typedef typename meta::bind_traits<F>::template arg_at<0> arg0; typedef typename meta::bind_traits<F>::template arg_at<0> arg0;
typedef meta::unqualified_t<std::remove_pointer_t<arg0>> T; typedef meta::unqualified_t<std::remove_pointer_t<arg0>> T;
return stack::push<detail::tagged<T, constructor_wrapper<F, Fxs...>>>(L, std::forward<C>(c)); return stack::push<detail::tagged<T, constructor_wrapper<F, Fxs...>>>(L, c);
}
static int push(lua_State* L, constructor_wrapper<F, Fxs...>&& c) {
typedef typename meta::bind_traits<F>::template arg_at<0> arg0;
typedef meta::unqualified_t<std::remove_pointer_t<arg0>> T;
return stack::push<detail::tagged<T, constructor_wrapper<F, Fxs...>>>(L, std::move(c));
} }
}; };
@ -17819,6 +17875,28 @@ namespace sol {
} }
}; };
template <typename T, typename F, typename... Filters>
struct unqualified_pusher<detail::tagged<T, filter_wrapper<F, Filters...>>> {
using P = filter_wrapper<F, Filters...>;
using Tagged = detail::tagged<T, P>;
static int push(lua_State* L, const Tagged& p) {
lua_CFunction cf = call_detail::call_user<T, false, false, P, 2>;
int upvalues = 0;
upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<P>>(L, p.value());
return stack::push(L, c_closure(cf, upvalues));
}
static int push(lua_State* L, Tagged&& p) {
lua_CFunction cf = call_detail::call_user<T, false, false, P, 2>;
int upvalues = 0;
upvalues += stack::push(L, nullptr);
upvalues += stack::push<user<P>>(L, std::move(p.value()));
return stack::push(L, c_closure(cf, upvalues));
}
};
template <typename T> template <typename T>
struct unqualified_pusher<push_invoke_t<T>> { struct unqualified_pusher<push_invoke_t<T>> {
static int push(lua_State* L, push_invoke_t<T>&& pi) { static int push(lua_State* L, push_invoke_t<T>&& pi) {
@ -22928,25 +23006,10 @@ namespace sol {
friend class basic_table_core; friend class basic_table_core;
template <std::size_t... I, typename... Args> template <std::size_t... I, typename... Args>
void tuple_set(std::index_sequence<I...> indices, std::tuple<Args...>&& args) { void tuple_set(std::index_sequence<I...>, std::tuple<Args...>&& args) {
using args_tuple = std::tuple<Args...>&&;
lua_State* L = this->lua_state();
optional<u_detail::usertype_storage<T>&> maybe_uts = u_detail::maybe_get_usertype_storage<T>(L);
if constexpr (sizeof...(I) > 0) {
if (maybe_uts) {
u_detail::usertype_storage<T>& uts = *maybe_uts;
(void)detail::swallow{ 0,
(uts.set(L, std::get<I * 2>(std::forward<args_tuple>(args)), std::get<I * 2 + 1>(std::forward<args_tuple>(args))),
0)... };
}
else {
table_base_t::template tuple_set<false>(indices, std::move(args));
}
}
else {
(void)indices;
(void)args; (void)args;
} (void)detail::swallow{ 0,
(this->set(std::get<I * 2>(std::move(args)), std::get<I * 2 + 1>(std::move(args))), 0)... };
} }
public: public:
@ -22969,7 +23032,15 @@ namespace sol {
uts.set(this->lua_state(), std::forward<Key>(key), std::forward<Value>(value)); uts.set(this->lua_state(), std::forward<Key>(key), std::forward<Value>(value));
} }
else { else {
base_t::set(std::forward<Key>(key), std::forward<Value>(value)); using ValueU = meta::unqualified_t<Value>;
// cannot get metatable: try regular table set?
if constexpr (detail::is_non_factory_constructor_v<ValueU> || detail::is_filter_v<ValueU>) {
// tag constructors so we don't get destroyed by lack of info
table_base_t::set(std::forward<Key>(key), detail::tagged<T, Value>(std::forward<Value>(value)));
}
else {
table_base_t::set(std::forward<Key>(key), std::forward<Value>(value));
}
} }
} }