mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
More reductions...
This commit is contained in:
parent
4a0bfe1960
commit
833be87011
|
@ -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 2016-06-27 16:25:12.814979 UTC
|
// Generated 2016-06-27 16:44:52.053533 UTC
|
||||||
// This header was generated with sol v2.8.9 (revision bd62d99)
|
// This header was generated with sol v2.8.9 (revision 4a0bfe1)
|
||||||
// https://github.com/ThePhD/sol2
|
// https://github.com/ThePhD/sol2
|
||||||
|
|
||||||
#ifndef SOL_SINGLE_INCLUDE_HPP
|
#ifndef SOL_SINGLE_INCLUDE_HPP
|
||||||
|
@ -121,6 +121,12 @@ namespace sol {
|
||||||
template <std::size_t N, typename Tuple>
|
template <std::size_t N, typename Tuple>
|
||||||
using tuple_element_t = std::tuple_element_t<N, unqualified_t<Tuple>>;
|
using tuple_element_t = std::tuple_element_t<N, unqualified_t<Tuple>>;
|
||||||
|
|
||||||
|
template <std::size_t N, typename Tuple>
|
||||||
|
using unqualified_tuple_element = unqualified<tuple_element_t<N, Tuple>>;
|
||||||
|
|
||||||
|
template <std::size_t N, typename Tuple>
|
||||||
|
using unqualified_tuple_element_t = unqualified_t<tuple_element_t<N, Tuple>>;
|
||||||
|
|
||||||
} // meta
|
} // meta
|
||||||
} // sol
|
} // sol
|
||||||
|
|
||||||
|
@ -8780,9 +8786,10 @@ namespace sol {
|
||||||
typedef std::make_index_sequence<sizeof...(I) * 2> indices;
|
typedef std::make_index_sequence<sizeof...(I) * 2> indices;
|
||||||
typedef std::index_sequence<I...> half_indices;
|
typedef std::index_sequence<I...> half_indices;
|
||||||
typedef std::array<luaL_Reg, sizeof...(Tn) / 2 + 1> regs_t;
|
typedef std::array<luaL_Reg, sizeof...(Tn) / 2 + 1> regs_t;
|
||||||
|
typedef std::tuple<Tn...> Tuple;
|
||||||
template <std::size_t Idx>
|
template <std::size_t Idx>
|
||||||
struct check_binding : is_variable_binding<meta::unqualified_t<std::tuple_element_t<Idx, std::tuple<Tn...>>>> {};
|
struct check_binding : is_variable_binding<meta::unqualified_tuple_element_t<Idx, Tuple>> {};
|
||||||
std::tuple<Tn...> functions;
|
Tuple functions;
|
||||||
lua_CFunction indexfunc;
|
lua_CFunction indexfunc;
|
||||||
lua_CFunction newindexfunc;
|
lua_CFunction newindexfunc;
|
||||||
lua_CFunction destructfunc;
|
lua_CFunction destructfunc;
|
||||||
|
@ -8792,13 +8799,13 @@ namespace sol {
|
||||||
bool mustindex;
|
bool mustindex;
|
||||||
bool secondarymeta;
|
bool secondarymeta;
|
||||||
|
|
||||||
template <std::size_t>
|
template <std::size_t Idx, meta::enable<std::is_same<lua_CFunction, meta::unqualified_tuple_element<Idx + 1, Tuple>>> = meta::enabler>
|
||||||
static inline lua_CFunction make_func(lua_CFunction f) {
|
inline lua_CFunction make_func() {
|
||||||
return f;
|
return std::get<Idx + 1>(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t Idx, typename F>
|
template <std::size_t Idx, meta::disable<std::is_same<lua_CFunction, meta::unqualified_tuple_element<Idx + 1, Tuple>>> = meta::enabler>
|
||||||
static inline lua_CFunction make_func(F&&) {
|
inline lua_CFunction make_func() {
|
||||||
return call<Idx + 1>;
|
return call<Idx + 1>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8813,7 +8820,7 @@ namespace sol {
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
int finish_regs(regs_t& l, int& index ) {
|
int finish_regs(regs_t& l, int& index) {
|
||||||
if (destructfunc != nullptr) {
|
if (destructfunc != nullptr) {
|
||||||
l[index] = { name_of(meta_function::garbage_collect).c_str(), destructfunc };
|
l[index] = { name_of(meta_function::garbage_collect).c_str(), destructfunc };
|
||||||
++index;
|
++index;
|
||||||
|
@ -8850,8 +8857,8 @@ namespace sol {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t Idx, typename N, typename F, typename = std::enable_if_t<!meta::any_same<meta::unqualified_t<N>, base_classes_tag, call_construction>::value>>
|
template <std::size_t Idx, typename N, typename F, typename = std::enable_if_t<!meta::any_same<meta::unqualified_t<N>, base_classes_tag, call_construction>::value>>
|
||||||
void make_regs(regs_t& l, int& index, N&& n, F&& f) {
|
void make_regs(regs_t& l, int& index, N&& n, F&&) {
|
||||||
luaL_Reg reg = usertype_detail::make_reg(std::forward<N>(n), make_func<Idx>(std::forward<F>(f)));
|
luaL_Reg reg = usertype_detail::make_reg(std::forward<N>(n), make_func<Idx>());
|
||||||
// Returnable scope
|
// Returnable scope
|
||||||
// That would be a neat keyword for C++
|
// That would be a neat keyword for C++
|
||||||
// returnable { ... };
|
// returnable { ... };
|
||||||
|
|
|
@ -68,6 +68,12 @@ namespace sol {
|
||||||
template <std::size_t N, typename Tuple>
|
template <std::size_t N, typename Tuple>
|
||||||
using tuple_element_t = std::tuple_element_t<N, unqualified_t<Tuple>>;
|
using tuple_element_t = std::tuple_element_t<N, unqualified_t<Tuple>>;
|
||||||
|
|
||||||
|
template <std::size_t N, typename Tuple>
|
||||||
|
using unqualified_tuple_element = unqualified<tuple_element_t<N, Tuple>>;
|
||||||
|
|
||||||
|
template <std::size_t N, typename Tuple>
|
||||||
|
using unqualified_tuple_element_t = unqualified_t<tuple_element_t<N, Tuple>>;
|
||||||
|
|
||||||
} // meta
|
} // meta
|
||||||
} // sol
|
} // sol
|
||||||
|
|
||||||
|
|
|
@ -97,9 +97,10 @@ namespace sol {
|
||||||
typedef std::make_index_sequence<sizeof...(I) * 2> indices;
|
typedef std::make_index_sequence<sizeof...(I) * 2> indices;
|
||||||
typedef std::index_sequence<I...> half_indices;
|
typedef std::index_sequence<I...> half_indices;
|
||||||
typedef std::array<luaL_Reg, sizeof...(Tn) / 2 + 1> regs_t;
|
typedef std::array<luaL_Reg, sizeof...(Tn) / 2 + 1> regs_t;
|
||||||
|
typedef std::tuple<Tn...> Tuple;
|
||||||
template <std::size_t Idx>
|
template <std::size_t Idx>
|
||||||
struct check_binding : is_variable_binding<meta::unqualified_t<std::tuple_element_t<Idx, std::tuple<Tn...>>>> {};
|
struct check_binding : is_variable_binding<meta::unqualified_tuple_element_t<Idx, Tuple>> {};
|
||||||
std::tuple<Tn...> functions;
|
Tuple functions;
|
||||||
lua_CFunction indexfunc;
|
lua_CFunction indexfunc;
|
||||||
lua_CFunction newindexfunc;
|
lua_CFunction newindexfunc;
|
||||||
lua_CFunction destructfunc;
|
lua_CFunction destructfunc;
|
||||||
|
@ -109,13 +110,13 @@ namespace sol {
|
||||||
bool mustindex;
|
bool mustindex;
|
||||||
bool secondarymeta;
|
bool secondarymeta;
|
||||||
|
|
||||||
template <std::size_t>
|
template <std::size_t Idx, meta::enable<std::is_same<lua_CFunction, meta::unqualified_tuple_element<Idx + 1, Tuple>>> = meta::enabler>
|
||||||
static inline lua_CFunction make_func(lua_CFunction f) {
|
inline lua_CFunction make_func() {
|
||||||
return f;
|
return std::get<Idx + 1>(functions);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t Idx, typename F>
|
template <std::size_t Idx, meta::disable<std::is_same<lua_CFunction, meta::unqualified_tuple_element<Idx + 1, Tuple>>> = meta::enabler>
|
||||||
static inline lua_CFunction make_func(F&&) {
|
inline lua_CFunction make_func() {
|
||||||
return call<Idx + 1>;
|
return call<Idx + 1>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +131,7 @@ namespace sol {
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
int finish_regs(regs_t& l, int& index ) {
|
int finish_regs(regs_t& l, int& index) {
|
||||||
if (destructfunc != nullptr) {
|
if (destructfunc != nullptr) {
|
||||||
l[index] = { name_of(meta_function::garbage_collect).c_str(), destructfunc };
|
l[index] = { name_of(meta_function::garbage_collect).c_str(), destructfunc };
|
||||||
++index;
|
++index;
|
||||||
|
@ -167,8 +168,8 @@ namespace sol {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <std::size_t Idx, typename N, typename F, typename = std::enable_if_t<!meta::any_same<meta::unqualified_t<N>, base_classes_tag, call_construction>::value>>
|
template <std::size_t Idx, typename N, typename F, typename = std::enable_if_t<!meta::any_same<meta::unqualified_t<N>, base_classes_tag, call_construction>::value>>
|
||||||
void make_regs(regs_t& l, int& index, N&& n, F&& f) {
|
void make_regs(regs_t& l, int& index, N&& n, F&&) {
|
||||||
luaL_Reg reg = usertype_detail::make_reg(std::forward<N>(n), make_func<Idx>(std::forward<F>(f)));
|
luaL_Reg reg = usertype_detail::make_reg(std::forward<N>(n), make_func<Idx>());
|
||||||
// Returnable scope
|
// Returnable scope
|
||||||
// That would be a neat keyword for C++
|
// That would be a neat keyword for C++
|
||||||
// returnable { ... };
|
// returnable { ... };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user