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
The class template `projection_compare` can be used to embed a comparison and a projection in a single comparison object, allowing to provide projection support to algorithms that only support comparisons, such as standard library algorithms prior to C++20. Both the passed comparison and projection functions can be [*Callable*][callable].
97
+
The class template `projection_compare_t` can be used to embed a comparison and a projection in a single comparison object, allowing to provide projection support to algorithms that only support comparisons, such as standard library algorithms prior to C++20. Both the passed comparison and projection functions can be [*Callable*][callable].
98
98
99
-
It is accompanied by a `make_projection_compare` function template to avoid having to pass the template parameters by hand.
99
+
It is accompanied by a `projection_compare` function template to avoid having to pass the template parameters by hand, and to perform a few optimizations.
`projection_compare<C, P>` has the following member functions:
109
+
`projection_compare_t<C, P>` has the following member functions:
110
110
111
111
```cpp
112
112
// Construction
113
-
projection_compare() = default;
114
-
projection_compare(C comp, P proj);
113
+
projection_compare_t() = default;
114
+
projection_compare_t(C comp, P proj);
115
115
116
116
// Call
117
117
template<typename T1, typename T2>
@@ -132,12 +132,12 @@ constexpr auto projection() const
132
132
-> P;
133
133
```
134
134
135
-
`cppsort::make_projection_compare` takes two *Callable*of types `C` and `P` and returns an instance of `projection_compare<std::decay_t<C>, std::decay_t<P>>` except in the following cases:
135
+
`cppsort::projection_compare` takes two *Callable* types `C` and `P` and returns an instance of `projection_compare_t<std::decay_t<C>, std::decay_t<P>>` except in the following cases:
136
136
* When `std::decay_t<P>` is of type [`utility::identity`][utility-identity] or [`std::identity`][std-identity], it returns `C` directly.
137
137
138
-
`projection_compare` is [*transparent*][transparent-func] when the passed comparison and projection are both *transparent*.
138
+
`projection_compare_t` is [*transparent*][transparent-func] when the passed comparison and projection are both *transparent*.
139
139
140
-
`projection_compare` is considered [branchless][branchless-traits] when the projection it wraps is considered branchless and the comparison it wraps is considered branchless when called with the result of the projection.
140
+
`projection_compare_t` is considered [branchless][branchless-traits] when the projection it wraps is considered branchless and the comparison it wraps is considered branchless when called with the result of the projection.
0 commit comments