The previous implementation was potentially buggy for cases when the Unwrapping call operator is called more than once, since f was for the actual call.
As far as I could tell we're not actually affected by this bug since we only ever call the Unwrapping call operator once.
This splits the call operator into two && and & qualified overloads, with the latter not moving f. Note that the latter is not const& because that would fail with wrapped call operators that are not const-qualified. The Duplicate call operator was one such call operator. I've changed the latter to be const-qualified but I've also left the Unwrapping call operator as & in case we introduce other call operators that actually need to be non-const.
@aurianer you can apply the same change in #930 to ConsumeRvalues.
The previous implementation was potentially buggy for cases when the
Unwrapping
call operator is called more than once, sincef
was for the actual call.As far as I could tell we're not actually affected by this bug since we only ever call the
Unwrapping
call operator once.This splits the call operator into two
&&
and&
qualified overloads, with the latter not movingf
. Note that the latter is notconst&
because that would fail with wrapped call operators that are not const-qualified. TheDuplicate
call operator was one such call operator. I've changed the latter to be const-qualified but I've also left theUnwrapping
call operator as&
in case we introduce other call operators that actually need to be non-const.@aurianer you can apply the same change in #930 to
ConsumeRvalues
.