I've been using MSVC 19 happily for a while now, with no particular rush to play with C++20 something...
Until today I tried to use a templated lambda with a parameter pack.
1 2 3 4
|
auto arg_in = [&arg] <typename...Args> ( Args...args ) -> bool
{
return (... || (arg == args));
};
|
MSVC 19 couldn't cut it.
Foo.
[edit] fixed a typo...
Last edited on
2019's 16.11.2 is the panacea you need for that.
There is even a flag/IDE setting to compile against C++20 instead of C++:latest.
Yeah, Clang++ 9.0 did it just fine with -std=c++2a.
All for a little readability later, I guess.
Didn't test it, but it looks like you wrote template where you should have written typename.
Argh. Alas, that was just a typo when posting here.
lol, I never saw this syntax anyway, but now it compiles fine..
That's something I never saw before. Looks awfully handy.
Welcome to MS22 :)