mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 12:44:42 +03:00
+= structured bindings mentioning; -= '\n' (#1646)
It worth to mention the *structured bindings* right in the *Reason* section.
This commit is contained in:
@@ -3076,8 +3076,7 @@ The argument against is prevents (very frequent) use of move semantics.
|
|||||||
##### Reason
|
##### Reason
|
||||||
|
|
||||||
A return value is self-documenting as an "output-only" value.
|
A return value is self-documenting as an "output-only" value.
|
||||||
Note that C++ does have multiple return values, by convention of using a `tuple` (including `pair`),
|
Note that C++ does have multiple return values, by convention of using a `tuple` (including `pair`), possibly with the extra convenience of `tie` or structured bindings (C++17) at the call site.
|
||||||
possibly with the extra convenience of `tie` at the call site.
|
|
||||||
Prefer using a named struct where there are semantics to the returned value. Otherwise, a nameless `tuple` is useful in generic code.
|
Prefer using a named struct where there are semantics to the returned value. Otherwise, a nameless `tuple` is useful in generic code.
|
||||||
|
|
||||||
##### Example
|
##### Example
|
||||||
|
|||||||
Reference in New Issue
Block a user