mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
fix incorrect reason for F.48
This commit is contained in:
parent
db079ab301
commit
e376433300
|
@ -3922,7 +3922,9 @@ value) of any assignment operator.
|
|||
|
||||
##### Reason
|
||||
|
||||
With guaranteed copy elision, it is now almost always a pessimization to expressly use `std::move` in a return statement.
|
||||
Returning a local variable implicitly moves it anyway.
|
||||
An explicit `std::move` is also a pessimization, because it prevents Named Return Value Optimization (NRVO),
|
||||
which can eliminate the move completely.
|
||||
|
||||
##### Example, bad
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user