Thursday, 8 August 2013

VS2013 Compiler bug with nested lambda and types

VS2013 Compiler bug with nested lambda and types

This code compiles fine on ideone but not on Visual Studio 2013. Is it a
compiler bug?
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v1, v2;
typedef decltype(v1) t1;
std::for_each(v1.begin(), v1.end(), [&](const t1::value_type& a1)
{
typedef decltype(v2) t2;
std::for_each(v2.begin(), v2.end(), [&](const
t2::value_type a2)
{
});
});
}
error C2825: 't2': must be a class or namespace when followed by '::'
http://ideone.com/kGtTrB

No comments:

Post a Comment