You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Chainable-projections.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Sometimes one needs to apply several transformations to the elements of a collec
4
4
5
5
```cpp
6
6
structmy_negate:
7
-
cppsort::utility::projection_base
7
+
cppsort::utility::projection_base<my_negate>
8
8
{
9
9
int operator()(int value) const
10
10
{
@@ -13,7 +13,7 @@ struct my_negate:
13
13
};
14
14
```
15
15
16
-
Making a function object inherit from `utility::projection_base` allows it to benefit from the `operator|` overload used to compose projections; the projection inheriting from that class can appear on any side of the operator, and the other argument can be any suitable [*Callable*][callable]. Here is an example of what is possible with the custom projection defined above:
16
+
Making a function object `F`inherit from `utility::projection_base<F>` allows it to benefit from the `operator|` overload used to compose projections; the projection inheriting from that class can appear on any side of the operator, and the other argument can be any suitable [*Callable*][callable]. Here is an example of what is possible with the custom projection defined above:
Copy file name to clipboardExpand all lines: docs/Miscellaneous-utilities.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,7 @@ This buffer provider allocates on the heap a number of elements depending on a g
159
159
160
160
***WARNING:**`utility::identity` is removed in version 2.0.0, use `std::identity` instead.*
161
161
162
-
This header provides the class `projection_base` and the mechanism used to compose projections with `operator|`. See [Chainable projections][chainable-projections] for more information.
162
+
This header provides the class template `projection_base` and the mechanism used to compose projections with `operator|`. See [Chainable projections][chainable-projections] for more information.
163
163
164
164
Also available in this header, the struct `identity` is a function object that can type any value of any movable type and return it as is. It is used as a default for every projection parameter in the library so that sorters view the values as they are by default, without a modification.
165
165
@@ -181,7 +181,7 @@ Another simple yet very handy projection available in the header is `indirect`:
0 commit comments