Today, I stumbled across the following code snippet:
#include <utility>
int main()
{
auto a = [](std::pair<auto, auto> value)
{
};
a(std::pair<int, bool>{ 3, true });
}
I have only one question: is this code supported by the standard?
It compiles in GCC (with -std=c++14
), but not clang or Visual Studio 2015 (VC++14).
This seems like it should be part of the standard because if lambdas should have the same template support as regular functions, then this should be supported.
This seems to convert to all template types, not just std::pair
.
Aucun commentaire:
Enregistrer un commentaire