as uses auto and decltype for return type

This commit is contained in:
ThePhD 2014-05-29 02:32:05 -04:00
parent b153b34334
commit c5d43bcfb6

View File

@ -32,7 +32,8 @@ public:
object() = default; object() = default;
template<typename T> template<typename T>
T as() const { auto as() const
-> 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());