Is the situation changed in the new standard, C ++ 14?
The Lambda expression is still not displayed in the unvalued operand - the same quote as in the Xeo Post also exists in the latest publicly available N3797 project, in exactly the same place.
However, each type of closure has a remote default constructor (N3797, §5.1.2 / 20):
The closure type associated with the lambda expression is deleted (8.4.3) and the delete copy delete statement.
So, for portabiliby and standard compliance (and probably for working code on reasonable compilers) you will need to pass the closure object to the constructor of the instance class for copying. But in order to pass a closure object of the same type as the template argument of this specialization , you must define it anyway:
using my_map_type = map<int, int, decltype([] (auto&& lhs, auto&& rhs) {return lhs < rhs*4;})>;
There is no legal way to create a single object such as closing the first lambda. Therefore, even if the specified rule must be deleted, you cannot create one instance of my_map_type . Similar problems arise with other scenarios such as closure as a pattern.
source share