Date: Thu, 10 Apr 2025 14:22:01 +0200
On 2025-04-10 at 13:14, Jan Schultke via Std-Proposals wrote:
> Another obvious problem with automatic forwarding is that some code
> intentionally copies ranges. For example, I might want to provide
> strong exception guarantees, and cannot do that when moving a range
> throws. In that event, I may copy it, even though the function
> template takes a forwarding reference.
So perhaps we could add a std::not_move for the exception cases? :-)
It seems like we would still have to analyze each case separately and
decide if the default is what we want. This is of course much easier to
do if we only have one default, like now.
> Another obvious problem with automatic forwarding is that some code
> intentionally copies ranges. For example, I might want to provide
> strong exception guarantees, and cannot do that when moving a range
> throws. In that event, I may copy it, even though the function
> template takes a forwarding reference.
So perhaps we could add a std::not_move for the exception cases? :-)
It seems like we would still have to analyze each case separately and
decide if the default is what we want. This is of course much easier to
do if we only have one default, like now.
Received on 2025-04-10 12:22:08