This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/81482] by-value lambda capture in remove_if
- From: "fabian-gcc at kloetzl dot info" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Aug 2017 10:07:28 +0000
- Subject: [Bug libstdc++/81482] by-value lambda capture in remove_if
- Auto-submitted: auto-generated
- References: <bug-81482-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81482
--- Comment #4 from kloetzl <fabian-gcc at kloetzl dot info> ---
> And changing the algorithm to make no copies would not make it opaque, because
> the lack of copies would be observable. As the standard says, whether copies
> are made or not is unspecified. So if you want to treat them as opaque, don't
> do something that depends on the internal details, use them as suggested by the
> note in the standard.
I see that changing the behaviour might be a bigger issue than the quirks
itself. Fixing this on the client side by changing the capture to by-reference
is trivial. I just fear that developers might waste quite some working hours
trying to figure it out for themselves.
Feel free to close this as wontfix/notabug. ☺