I\'ve run into a strange problem. The following simplified code reproduces the problem in MSVC 2010:
template
struct dummy
{
static T f
This is not really an answer to your question, but just exploring the problem further. I was wondering if the compiler has issues dealing with types declared in an enclosing scope, so tried this out:
#include
template
void do_test(Func pFunc) {
}
template
void test_trait(void) {
class Something { public: int foo; };
do_test ([] (T pX) {
Something A; A.foo = 12;
});
}
int main(void) {
test_trait ();
}
Here, I'm just trying to create a local type in the enclosing scope and use it from within the lambda function. Not only does this not compile (with Visual Studio 2010, Beta 2) but it actually crashes the compiler with a C1001 internal error.