Sunday, July 14, 2019

c++ - msvc std::function doesn't accept generic lambda with a nested lambda

The following works with gcc 5.2 and clang 3.7 but fails with msvc 2015:



#include 

int main()
{
auto const foo = [](auto&& i) {

auto const bar = []{ return 100; };
return bar();
};

std::function fn = foo;
return 0;
}


Is it a bug in msvc or are gcc and clang too lax?

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...