wew containers and perfect matching ye

This commit is contained in:
ThePhD 2019-07-01 05:44:53 -04:00
parent 1ab57fc11e
commit 52dc19a75a
No known key found for this signature in database
GPG Key ID: 1509DB1C0F702BFA
3 changed files with 34 additions and 6 deletions

View File

@ -70,10 +70,16 @@ namespace sol {
using base_t::base_t; using base_t::base_t;
}; };
template <typename Al>
struct is_container<basic_variadic_results<Al>> : std::false_type {};
template <>
struct is_container<variadic_results> : std::false_type {};
namespace stack { namespace stack {
template <typename Al> template <typename Al>
struct unqualified_pusher<basic_variadic_results<Al>> { struct unqualified_pusher<basic_variadic_results<Al>> {
int push(lua_State* L, const variadic_results& e) { int push(lua_State* L, const basic_variadic_results<Al>& e) {
int p = 0; int p = 0;
for (const auto& i : e) { for (const auto& i : e) {
p += stack::push(L, i); p += stack::push(L, i);
@ -81,6 +87,14 @@ namespace sol {
return p; return p;
} }
}; };
template <>
struct unqualified_pusher<variadic_results> {
int push(lua_State* L, const variadic_results& r) {
using base_t = basic_variadic_results<>;
return stack::push(L, static_cast<const base_t&>(r));
}
};
} // namespace stack } // namespace stack
} // namespace sol } // namespace sol

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-07-01 06:13:08.602308 UTC // Generated 2019-07-01 09:44:31.228110 UTC
// This header was generated with sol v3.0.2 (revision b08387d) // This header was generated with sol v3.0.2 (revision 1ab57fc)
// 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-07-01 06:13:07.719429 UTC // Generated 2019-07-01 09:44:30.937884 UTC
// This header was generated with sol v3.0.2 (revision b08387d) // This header was generated with sol v3.0.2 (revision 1ab57fc)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP #ifndef SOL_SINGLE_INCLUDE_HPP
@ -25733,10 +25733,16 @@ namespace sol {
using base_t::base_t; using base_t::base_t;
}; };
template <typename Al>
struct is_container<basic_variadic_results<Al>> : std::false_type {};
template <>
struct is_container<variadic_results> : std::false_type {};
namespace stack { namespace stack {
template <typename Al> template <typename Al>
struct unqualified_pusher<basic_variadic_results<Al>> { struct unqualified_pusher<basic_variadic_results<Al>> {
int push(lua_State* L, const variadic_results& e) { int push(lua_State* L, const basic_variadic_results<Al>& e) {
int p = 0; int p = 0;
for (const auto& i : e) { for (const auto& i : e) {
p += stack::push(L, i); p += stack::push(L, i);
@ -25744,6 +25750,14 @@ namespace sol {
return p; return p;
} }
}; };
template <>
struct unqualified_pusher<variadic_results> {
int push(lua_State* L, const variadic_results& r) {
using base_t = basic_variadic_results<>;
return stack::push(L, static_cast<const base_t&>(r));
}
};
} // namespace stack } // namespace stack
} // namespace sol } // namespace sol