diff --git a/include/boost/stl_interfaces/view_adaptor.hpp b/include/boost/stl_interfaces/view_adaptor.hpp index 03199a4..468297e 100644 --- a/include/boost/stl_interfaces/view_adaptor.hpp +++ b/include/boost/stl_interfaces/view_adaptor.hpp @@ -242,11 +242,24 @@ namespace boost { namespace stl_interfaces { typename Enable = std::enable_if_t>> #endif - constexpr decltype(auto) operator()(T && t) const + constexpr decltype(auto) operator()(T && t) const & { return f_((T &&) t); } +#if BOOST_STL_INTERFACES_USE_CONCEPTS + template + requires std::invocable +#else + template< + typename T, + typename Enable = std::enable_if_t>> +#endif + constexpr decltype(auto) operator()(T && t) && + { + return std::move(f_)((T &&) t); + } + private: F f_; };