mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Added xref to Rf-out per issue #390
This commit is contained in:
parent
a8b6bf4b7c
commit
3fa4b5623b
|
@ -13892,7 +13892,7 @@ To provide statically type-safe manipulation of elements.
|
|||
|
||||
##### Reason
|
||||
|
||||
To simplify code and eliminate a need for explicit memory management. To bring an object into a surrounding scope, thereby extending its lifetime.
|
||||
To simplify code and eliminate a need for explicit memory management. To bring an object into a surrounding scope, thereby extending its lifetime. See also [the general item about "out" output values](#Rf-out).
|
||||
|
||||
##### Example
|
||||
|
||||
|
@ -13903,14 +13903,15 @@ To simplify code and eliminate a need for explicit memory management. To bring a
|
|||
|
||||
auto v = get_large_vector(); // return by value is ok, most modern compilers will do copy elision
|
||||
|
||||
##### Example
|
||||
##### Exceptions
|
||||
|
||||
??? factory
|
||||
See the Exceptions in ["out" output values](#Rf-out).
|
||||
|
||||
##### Enforcement
|
||||
|
||||
Check for pointers and references returned from functions and see if they are assigned to resource handles (e.g., to a `unique_ptr`).
|
||||
|
||||
|
||||
### <a name="Cr-handle"></a> If a class is a resource handle, it needs a constructor, a destructor, and copy and/or move operations
|
||||
|
||||
##### Reason
|
||||
|
|
Loading…
Reference in New Issue
Block a user