Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fea8841

Browse files
committed
Blend new F.47 into existing text.
1 parent 7615d30 commit fea8841

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CppCoreGuidelines.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1820,6 +1820,7 @@ Value return semantic rules:
18201820
* [F.44: Return a `T&` when "returning no object" isn't an option](#Rf-return-ref)
18211821
* [F.45: Don't return a `T&&`](#Rf-return-ref-ref)
18221822
* [F.46: `int` is the return type for `main()`](#Rf-main)
1823+
* [F.47: Return `T&` from assignment operators.](#Rf-assignment-op)
18231824

18241825
Other function rules:
18251826

@@ -2258,7 +2259,7 @@ For advanced uses (only), where you really need to optimize for rvalues passed t
22582259
Avoid "esoteric techniques" such as:
22592260

22602261
* 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).)
2261-
* Returning `const T&` from assignments and similar operations.
2262+
* Returning `const T&` from assignments and similar operations (see [F.47](#Rf-assignment-op).)
22622263

22632264
##### Example
22642265

@@ -2873,7 +2874,7 @@ Declaring `main` (the one global `main` of a program) `void` limits portability.
28732874
* The compiler should do it
28742875
* If the compiler doesn't do it, let tools flag it
28752876

2876-
### <a name="Rf-assignment-op"></a>F.46: Return `T&` from assignment operators.
2877+
### <a name="Rf-assignment-op"></a>F.47: Return `T&` from assignment operators.
28772878

28782879
##### Reason
28792880

0 commit comments

Comments
 (0)