@@ -6,9 +6,11 @@ modernize-use-structured-binding
6
6
Finds places where structured bindings could be used to decompose pairs and
7
7
suggests replacing them.
8
8
9
- This check finds three code patterns and recommends using structured bindings for clearer, more idiomatic C++17 code.
9
+ This check finds three code patterns and recommends using structured bindings
10
+ for clearer, more idiomatic C++17 code.
10
11
11
- 1. Decompose a pair variable by assigning its members to separate variables right after its definition:
12
+ 1. Decompose a pair variable by assigning its members to separate variables
13
+ right after its definition:
12
14
13
15
.. code-block :: c++
14
16
@@ -32,7 +34,8 @@ This check finds three code patterns and recommends using structured bindings fo
32
34
33
35
auto [a, b] = getPair<int, int>();
34
36
35
- 3. Manually decompose a pair by assigning to its members to local variables in a range-based for loop:
37
+ 3. Manually decompose a pair by assigning to its members to local variables
38
+ in a range-based for loop:
36
39
37
40
.. code-block :: c++
38
41
@@ -48,12 +51,14 @@ This check finds three code patterns and recommends using structured bindings fo
48
51
// use x and y
49
52
}
50
53
51
- The check also supports custom pair-like types via the :option: `PairTypes ` option.
54
+ The check also supports custom pair-like types via the :option: `PairTypes `
55
+ option.
52
56
53
57
Options
54
58
-------
55
59
56
60
.. option :: PairTypes
57
61
58
- A Semicolon-separated list of type names to be treated as pair-like for structured binding suggestions.
59
- Example: `MyPairType;OtherPairType `. Default is `std::pair `.
62
+ A Semicolon-separated list of type names to be treated as pair-like for
63
+ structured binding suggestions. Example: `MyPairType;OtherPairType `.
64
+ Default is `std::pair `.
0 commit comments