struct S
{
S();
S(S const&) = delete;
};
auto x = [s = S()]{};
It looks like MSVC doesn't apply (mandatory in C++17?) copy elision when building lambda. This breaks some of my code...
Does VC's behavior violate standard?
struct S
{
S();
S(S const&) = delete;
};
auto x = [s = S()]{};
It looks like MSVC doesn't apply (mandatory in C++17?) copy elision when building lambda. This breaks some of my code...
Does VC's behavior violate standard?
Per "Language Lawyer"s comment: this is a known bug in MSVC that has been fixed in VS19 v16.2 and VS17 v15.8. Unfortunately (as of now) fix works only with /std:c++latest.