update single

This commit is contained in:
ThePhD 2018-02-22 14:49:16 -05:00
parent f7f94a4f74
commit f85a06b31d
2 changed files with 21 additions and 6 deletions

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 2018-02-21 06:23:41.439083 UTC // Generated 2018-02-22 19:49:01.759217 UTC
// This header was generated with sol v2.19.0 (revision a56a890) // This header was generated with sol v2.19.4 (revision f7f94a4)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_HPP #ifndef SOL_SINGLE_INCLUDE_HPP
@ -5698,6 +5698,9 @@ namespace sol {
template <typename T> template <typename T>
struct is_environment : std::integral_constant<bool, is_userdata<T>::value || is_table<T>::value> {}; struct is_environment : std::integral_constant<bool, is_userdata<T>::value || is_table<T>::value> {};
template <typename T>
struct is_automagical : std::true_type {};
template <typename T> template <typename T>
inline type type_of() { inline type type_of() {
return lua_type_of<meta::unqualified_t<T>>::value; return lua_type_of<meta::unqualified_t<T>>::value;
@ -17138,8 +17141,10 @@ namespace sol {
template <typename T, typename Regs, meta::enable<meta::has_size<T>> = meta::enabler> template <typename T, typename Regs, meta::enable<meta::has_size<T>> = meta::enabler>
inline void make_length_op(Regs& l, int& index) { inline void make_length_op(Regs& l, int& index) {
typedef decltype(std::declval<T>().size()) R;
using sz_func = R(T::*)()const;
const char* name = to_string(meta_function::length).c_str(); const char* name = to_string(meta_function::length).c_str();
l[index] = luaL_Reg{ name, &c_call<decltype(&T::size), &T::size> }; l[index] = luaL_Reg{ name, &c_call<decltype(static_cast<sz_func>(&T::size)), static_cast<sz_func>(&T::size)> };
++index; ++index;
} }
@ -17169,7 +17174,12 @@ namespace sol {
} }
template <typename T, typename Regs, typename Fx> template <typename T, typename Regs, typename Fx>
void insert_default_registrations(Regs& l, int& index, Fx&& fx) { void insert_default_registrations(std::false_type, Regs&, int&, Fx&&) {
// no-op
}
template <typename T, typename Regs, typename Fx>
void insert_default_registrations(std::true_type, Regs& l, int& index, Fx&& fx) {
if (fx(meta_function::less_than)) { if (fx(meta_function::less_than)) {
const char* name = to_string(meta_function::less_than).c_str(); const char* name = to_string(meta_function::less_than).c_str();
usertype_detail::make_reg_op<T, std::less<>, meta::supports_op_less<T>>(l, index, name); usertype_detail::make_reg_op<T, std::less<>, meta::supports_op_less<T>>(l, index, name);
@ -17197,6 +17207,11 @@ namespace sol {
usertype_detail::make_call_op<T>(l, index); usertype_detail::make_call_op<T>(l, index);
} }
} }
template <typename T, typename Regs, typename Fx>
void insert_default_registrations(Regs& l, int& index, Fx&& fx) {
insert_default_registrations<T>(is_automagical<T>(), l, index, std::forward<Fx>(fx));
}
} // namespace usertype_detail } // namespace usertype_detail
namespace stack { namespace stack_detail { namespace stack { namespace stack_detail {

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 2018-02-21 06:23:41.719118 UTC // Generated 2018-02-22 19:49:02.041252 UTC
// This header was generated with sol v2.19.0 (revision a56a890) // This header was generated with sol v2.19.4 (revision f7f94a4)
// https://github.com/ThePhD/sol2 // https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP