For the same purpose as for arguments: so when Func::operator()
is a ref-qualified:
struct Functor
{
void operator ()() const & { std::cout << "lvalue functor\n"; }
void operator ()() const && { std::cout << "rvalue functor\n"; }
};
More Related Contents:
- How does generic lambda work in C++14?
- Capturing perfectly-forwarded variable in lambda
- Why do lambda functions drop deduced return type reference by default?
- Perfect forwaring of auto&& in generic lambda
- How to create an std::function from a move-capturing lambda expression?
- What are some uses of decltype(auto)?
- Why use std::bind over lambdas in C++14?
- What is the type of lambda when deduced with “auto” in C++11?
- Is auto as a parameter in a regular function a GCC 4.9 extension?
- Why are lambda expressions not allowed in an unevaluated operands but allowed in the unevaluated portions of constant expressions?
- c++ lambdas how to capture variadic parameter pack from the upper scope
- Lambda capture as const reference?
- How to immediately invoke a C++ lambda?
- Use of ‘auto func(int)’ before deduction of ‘auto’ in C++14
- C++11 Change `auto` Lambda to a different Lambda?
- C++ lambda with captures as a function pointer
- How to implement make_unique function in C++11? [duplicate]
- C++0x lambda capture by value always const?
- Pointers in c++ after delete
- Can the use of C++11’s ‘auto’ improve performance?
- C++ auto vs auto&
- undefined behaviour somewhere in boost::spirit::qi::phrase_parse
- Throw in constexpr function
- How do static variables in lambda function objects work?
- Lambdas and capture by reference local variables : Accessing after the scope
- Are lambdas inlined like functions in C++?
- Is C++20 ‘char8_t’ the same as our old ‘char’?
- how to specify vc11 lambda calling convention
- Reference invalidation after applying reverse_iterator on a custom made iterator
- When can we omit the return type in a C++11 lambda?