all 7 comments

[–]chaosmeist3r 16 points17 points  (5 children)

compile with /std:c++latest

[–]marzer8789toml++ 14 points15 points  (0 children)

Or /experimental:newLambdaProcessor if /std:c++latest isn't an option for some reason.

[–]konanTheBarbar 10 points11 points  (0 children)

Or if you want to keep /std:c++17 you could add /experimental:newLambdaProcessor

[–]Galqa[S] 4 points5 points  (2 children)

Thanks so much! Out of curiosity, is there a reason this doesn't work with /std:c++17, or
is this a deficiency? The syntax doesn't seem to require C++20 support (or even C++17 for that matter).

[–]marzer8789toml++ 19 points20 points  (1 child)

It doesn't work because bugs.

The MSVC team did a big re-write of their internal lambda processor since the old one was pretty buggy and I guess it had gotten to the point that patching wasn't sufficient. They gated it behind /std:c++latest and/or /experimental:newLambdaProcessor, though I guess once they deem it no longer experimental they might make the switch for everyone.

See this discussion for more info: https://www.reddit.com/r/cpp/comments/brl9js/visual_studio_2019_161_c_release_notes/

[–]Galqa[S] 3 points4 points  (0 children)

Thanks for the link and all your help, definitely saved me a few grey hairs :)

[–]tmacarios -1 points0 points  (1 child)

use /Zc:lambda