diff --git a/src/f2/function2.hpp b/src/f2/function2.hpp index dc81c7d..4ba16d0 100644 --- a/src/f2/function2.hpp +++ b/src/f2/function2.hpp @@ -1,5 +1,5 @@ -// Copyright 2015-2019 Denis Blank +// Copyright 2015-2020 Denis Blank // Distributed under the Boost Software License, Version 1.0 // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -990,13 +990,13 @@ public: /// Invoke the function at the given index template - constexpr auto invoke(Args&&... args) const { + constexpr decltype(auto) invoke(Args&&... args) const { auto thunk = invoke_table_t::template fetch(vtable_); return thunk(std::forward(args)...); } /// Invoke the function at the given index template - constexpr auto invoke(Args&&... args) const volatile { + constexpr decltype(auto) invoke(Args&&... args) const volatile { auto thunk = invoke_table_t::template fetch(vtable_); return thunk(std::forward(args)...); } @@ -1208,7 +1208,7 @@ public: /// We define this out of class to be able to forward the qualified /// erasure correctly. template - static constexpr auto invoke(Erasure&& erasure, Args&&... args) { + static constexpr decltype(auto) invoke(Erasure&& erasure, Args&&... args) { auto const capacity = erasure.capacity(); return erasure.vtable_.template invoke( std::forward(erasure).opaque_ptr(), capacity, @@ -1324,7 +1324,7 @@ public: } template - static constexpr auto invoke(Erasure&& erasure, T&&... args) { + static constexpr decltype(auto) invoke(Erasure&& erasure, T&&... args) { auto thunk = invoke_table_t::template fetch(erasure.invoke_table_); return thunk(&(erasure.view_), 0UL, std::forward(args)...); } @@ -1761,4 +1761,3 @@ constexpr auto overload(T&&... callables) { #undef FU2_DETAIL_TRAP #endif // FU2_INCLUDED_FUNCTION2_HPP_ -