[Bug libstdc++/100940] views::take and views::drop should not define _S_has_simple_extra_args
ppalka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jun 15 19:03:47 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100940
--- Comment #8 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to TC from comment #7)
> (In reply to Patrick Palka from comment #6)
> >
> > For the other adaptors, we still unconditionally disable perfect forwarding
> > call wrapper semantics. I'm not sure if the performance/diagnostic tradeoff
> > is worth it to enable perfect forwarding semantics when the function object
> > is non-trivial.
>
> Personally, I'd happily pay some diagnostic complexity when I get things
> wrong if that means I get better performance when I get things right. Good
> diagnostics only matter when my code is broken, while performance matters
> when my code is working. The former should (hopefully) be a transient
> condition.
Sounds good; a followup patch that implements this is at
https://gcc.gnu.org/pipermail/gcc-patches/2021-June/572829.html
The patch limits the "simple" forwarding case to only trivially copyable extra
arguments, and does so for all adaptors. So
take_while/drop_while/filter/transform(std::function) as well as
split(non_triv_copyable_view) would be considered non-simple under this
restriction.
More information about the Gcc-bugs
mailing list