From 3924087459f34e90a2f6840e8d65adb2ce68ee32 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 20 Jul 2017 13:16:07 +0100 Subject: [PATCH] Replace broken links to #Rf-pass-ref-ref and #Rf-pass-ref-move --- CppCoreGuidelines.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index d2552a7..fd79f6a 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2840,7 +2840,7 @@ For advanced uses (only), where you really need to optimize for rvalues passed t Avoid "esoteric techniques" such as: * Passing arguments as `T&&` "for efficiency". - Most rumors about performance advantages from passing by `&&` are false or brittle (but see [F.25](#Rf-pass-ref-move).) + Most rumors about performance advantages from passing by `&&` are false or brittle (but see [F.18](#Rf-consume) and [F.19](#Rf-forward).) * Returning `const T&` from assignments and similar operations (see [F.47](#Rf-assignment-op).) ##### Example @@ -3580,7 +3580,7 @@ Flag functions where no `return` expression could yield `nullptr` ##### Reason -It's asking to return a reference to a destroyed temporary object. A `&&` is a magnet for temporary objects. This is fine when the reference to the temporary is being passed "downward" to a callee, because the temporary is guaranteed to outlive the function call. (See [F.24](#Rf-pass-ref-ref) and [F.25](#Rf-pass-ref-move).) However, it's not fine when passing such a reference "upward" to a larger caller scope. See also ???. +It's asking to return a reference to a destroyed temporary object. A `&&` is a magnet for temporary objects. This is fine when the reference to the temporary is being passed "downward" to a callee, because the temporary is guaranteed to outlive the function call (see [F.18](#Rf-consume) and [F.19](#Rf-forward)). However, it's not fine when passing such a reference "upward" to a larger caller scope. See also ???. For passthrough functions that pass in parameters (by ordinary reference or by perfect forwarding) and want to return values, use simple `auto` return type deduction (not `auto&&`). @@ -5633,7 +5633,7 @@ Types can be defined to move for logical as well as performance reasons. ##### Reason -It is simple and efficient. If you want to optimize for rvalues, provide an overload that takes a `&&` (see [F.24](#Rf-pass-ref-ref)). +It is simple and efficient. If you want to optimize for rvalues, provide an overload that takes a `&&` (see [F.18](#Rf-consume)). ##### Example