mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
"constexpr" my ass.
This commit is contained in:
parent
88155d44e0
commit
90ea495d4c
|
@ -78,7 +78,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct bond_size<function_result> : std::integral_constant<std::size_t, std::numeric_limits<std::size_t>::max()> {};
|
struct bond_size<function_result> : std::integral_constant<std::size_t, SIZE_T_MAX> {};
|
||||||
|
|
||||||
template <std::size_t I>
|
template <std::size_t I>
|
||||||
stack_proxy get(const function_result& fr) {
|
stack_proxy get(const function_result& fr) {
|
||||||
|
|
|
@ -128,7 +128,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
struct bond_size<protected_function_result> : std::integral_constant<std::size_t, std::numeric_limits<std::size_t>::max()> {};
|
struct bond_size<protected_function_result> : std::integral_constant<std::size_t, SIZE_T_MAX> {};
|
||||||
|
|
||||||
template <std::size_t I>
|
template <std::size_t I>
|
||||||
stack_proxy get(const protected_function_result& fr) {
|
stack_proxy get(const protected_function_result& fr) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ inline std::pair<T, int> get_as_upvalues(lua_State* L, int index = 1) {
|
||||||
template <bool checkargs = default_check_arguments, std::size_t... I, typename R, typename... Args, typename Fx, typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
|
template <bool checkargs = default_check_arguments, std::size_t... I, typename R, typename... Args, typename Fx, typename... FxArgs, typename = std::enable_if_t<!std::is_void<R>::value>>
|
||||||
inline decltype(auto) call(types<R>, types<Args...> ta, std::index_sequence<I...> tai, lua_State* L, int start, Fx&& fx, FxArgs&&... args) {
|
inline decltype(auto) call(types<R>, types<Args...> ta, std::index_sequence<I...> tai, lua_State* L, int start, Fx&& fx, FxArgs&&... args) {
|
||||||
typedef meta::index_in_pack<this_state, Args...> state_pack_index;
|
typedef meta::index_in_pack<this_state, Args...> state_pack_index;
|
||||||
typedef std::integral_constant<int, state_pack_index::value == -1 ? std::numeric_limits<int>::max() : static_cast<int>(state_pack_index::value)> state_idx;
|
typedef std::integral_constant<int, state_pack_index::value == -1 ? INT_MAX : static_cast<int>(state_pack_index::value)> state_idx;
|
||||||
check_types<checkargs>{}.check(ta, tai, L, start, type_panic);
|
check_types<checkargs>{}.check(ta, tai, L, start, type_panic);
|
||||||
return fx(std::forward<FxArgs>(args)..., stack_detail::unchecked_get<Args>(L, start + (state_idx::value < I ? I - 1 : I))...);
|
return fx(std::forward<FxArgs>(args)..., stack_detail::unchecked_get<Args>(L, start + (state_idx::value < I ? I - 1 : I))...);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ inline decltype(auto) call(types<R>, types<Args...> ta, std::index_sequence<I...
|
||||||
template <bool checkargs = default_check_arguments, std::size_t... I, typename... Args, typename Fx, typename... FxArgs>
|
template <bool checkargs = default_check_arguments, std::size_t... I, typename... Args, typename Fx, typename... FxArgs>
|
||||||
inline void call(types<void>, types<Args...> ta, std::index_sequence<I...> tai, lua_State* L, int start, Fx&& fx, FxArgs&&... args) {
|
inline void call(types<void>, types<Args...> ta, std::index_sequence<I...> tai, lua_State* L, int start, Fx&& fx, FxArgs&&... args) {
|
||||||
typedef meta::index_in_pack<this_state, Args...> state_pack_index;
|
typedef meta::index_in_pack<this_state, Args...> state_pack_index;
|
||||||
typedef std::integral_constant<int, state_pack_index::value == -1 ? std::numeric_limits<int>::max() : static_cast<int>(state_pack_index::value)> state_idx;
|
typedef std::integral_constant<int, state_pack_index::value == -1 ? INT_MAX : static_cast<int>(state_pack_index::value)> state_idx;
|
||||||
check_types<checkargs>{}.check(ta, tai, L, start, type_panic);
|
check_types<checkargs>{}.check(ta, tai, L, start, type_panic);
|
||||||
fx(std::forward<FxArgs>(args)..., stack_detail::unchecked_get<Args>(L, start + (state_idx::value < I ? I - 1 : I))...);
|
fx(std::forward<FxArgs>(args)..., stack_detail::unchecked_get<Args>(L, start + (state_idx::value < I ? I - 1 : I))...);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user