mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
Stylistic changes to code
This commit is contained in:
parent
065215864b
commit
2376dc437b
|
@ -32,8 +32,7 @@ public:
|
||||||
object() = default;
|
object() = default;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
auto as() const
|
auto as() const -> decltype(stack::get<T>(state())) {
|
||||||
-> decltype(stack::get<T>(state())) {
|
|
||||||
push();
|
push();
|
||||||
type_assert(state(), -1, type_of<T>());
|
type_assert(state(), -1, type_of<T>());
|
||||||
return stack::get<T>(state());
|
return stack::get<T>(state());
|
||||||
|
|
|
@ -107,8 +107,7 @@ inline bool get_helper<bool>(std::true_type, lua_State* L, int index) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline auto get_helper(std::false_type, lua_State* L, int index = -1)
|
inline auto get_helper(std::false_type, lua_State* L, int index = -1) -> decltype(get(types<T>(), L, index)) {
|
||||||
-> decltype(get(types<T>(), L, index)) {
|
|
||||||
// T is a class
|
// T is a class
|
||||||
return get(types<T>(), L, index);
|
return get(types<T>(), L, index);
|
||||||
}
|
}
|
||||||
|
@ -137,8 +136,7 @@ inline void push_arithmetic(std::false_type, lua_State* L, T x) {
|
||||||
} // detail
|
} // detail
|
||||||
|
|
||||||
template<typename T, typename U = Unqualified<T>>
|
template<typename T, typename U = Unqualified<T>>
|
||||||
inline auto get(lua_State* L, int index = -1)
|
inline auto get(lua_State* L, int index = -1) -> decltype(detail::get_helper<U>(std::is_arithmetic<U>{}, L, index)) {
|
||||||
-> decltype(detail::get_helper<U>(std::is_arithmetic<U>{}, L, index)) {
|
|
||||||
return detail::get_helper<U>(std::is_arithmetic<U>{}, L, index);
|
return detail::get_helper<U>(std::is_arithmetic<U>{}, L, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,8 +152,7 @@ inline std::pair<T, int> get_user(lua_State* L, int index = 1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
auto pop(lua_State* L)
|
auto pop(lua_State* L) -> decltype(get<T>(L)) {
|
||||||
-> decltype(get<T>(L)) {
|
|
||||||
auto&& r = get<T>(L);
|
auto&& r = get<T>(L);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user