Lambdas don't appear to work within ref classes in VS2010
问题 One of the cool new C++ features in Visual Studio 2010 are lambda expressions. However, I can't get them to work within a managed class. class UnmanagedClass { void Foo() { // Creating empty lambda within unmanaged class. // This compiles fine. auto lambda = [](){ ; }; } }; ref class ManagedClass { void Foo() { // Creating empty lambda within managed class. // This creates error C3809: // A managed type cannot have any friend functions/classes/interfaces. auto lambda = [](){ ; }; } }; My best