mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
as uses auto and decltype for return type
This commit is contained in:
parent
b153b34334
commit
c5d43bcfb6
|
@ -32,7 +32,8 @@ public:
|
|||
object() = default;
|
||||
|
||||
template<typename T>
|
||||
T as() const {
|
||||
auto as() const
|
||||
-> decltype(stack::get<T>(state())) {
|
||||
push();
|
||||
type_assert(state(), -1, type_of<T>());
|
||||
return stack::get<T>(state());
|
||||
|
|
Loading…
Reference in New Issue
Block a user