"constexpr" my ass.

This commit is contained in:
ThePhD 2016-04-17 02:26:18 -04:00
parent 88155d44e0
commit 90ea495d4c
3 changed files with 4 additions and 4 deletions

View File

@ -78,7 +78,7 @@ public:
};
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>
stack_proxy get(const function_result& fr) {

View File

@ -128,7 +128,7 @@ public:
};
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>
stack_proxy get(const protected_function_result& fr) {

View File

@ -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>>
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 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);
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>
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 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);
fx(std::forward<FxArgs>(args)..., stack_detail::unchecked_get<Args>(L, start + (state_idx::value < I ? I - 1 : I))...);
}