Sunday 14 July 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

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...