Stylistic changes to code

This commit is contained in:
Rapptz 2014-05-29 02:57:11 -04:00
parent 065215864b
commit 2376dc437b
2 changed files with 5 additions and 9 deletions

View File

@ -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());
@ -69,4 +68,4 @@ inline bool operator!=(const nil_t&, const object& rhs) {
} }
} // sol } // sol
#endif // SOL_OBJECT_HPP #endif // SOL_OBJECT_HPP

View File

@ -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;