This page contains the documentation for several class and function templates for comparing words or strings with respect to certain reduction orderings.
|
template<typename T> |
bool | lexicographical_compare (T *const x, T *const y) |
| Compare two objects via their pointers using std::lexicographical_compare.
|
|
template<typename T, typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>> |
bool | lexicographical_compare (T const &x, T const &y) |
| Compare two objects of the same type using std::lexicographical_compare.
|
|
template<typename T> |
bool | recursive_path_compare (T *const x, T *const y) noexcept |
| Compare two objects via their pointers using recursive_path_compare.
|
|
template<typename T, typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>> |
bool | recursive_path_compare (T const &first1, T last1, T const &first2, T last2) noexcept |
| Compare two objects of the same type using the recursive path comparison.
|
|
template<typename T, typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>> |
bool | recursive_path_compare (T const &x, T const &y) noexcept |
| Compare two objects of the same type using recursive_path_compare.
|
|
template<typename T> |
bool | shortlex_compare (T *const x, T *const y) |
| Compare two objects via their pointers using shortlex_compare.
|
|
template<typename T, typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>> |
bool | shortlex_compare (T const &first1, T const &last1, T const &first2, T const &last2) |
| Compare two objects of the same type using the short-lex reduction ordering.
|
|
template<typename T, typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>> |
bool | shortlex_compare (T const &x, T const &y) |
| Compare two objects of the same type using shortlex_compare.
|
|
template<typename T, typename = std::enable_if_t<!rx::is_input_or_sink_v<T>>>
bool recursive_path_compare |
( |
T const & | first1, |
|
|
T | last1, |
|
|
T const & | first2, |
|
|
T | last2 ) |
|
noexcept |
Defined in order.hpp
.
Compare two objects of the same type using the recursive path comparison described in [37] (Definition 1.2.14, page 24).
If \(u, v\in X ^ {*}\), \(u \neq v\), and \(u = a'u\), \(v = bv'\) for some \(a,b \in X\), \(u',v'\in X ^ {*}\), then \(u > v\) if one of the following conditions holds:
- \(a = b\) and \(u' \geq v'\);
- \(a > b\) and \(u > v'\);
- \(b > a\) and \(u' > v\).
This documentation and the implementation of recursive_path_compare is based on the source code of [34].
- Template Parameters
-
T | the type of iterators to the first object to be compared. |
- Parameters
-
first1 | beginning iterator of first object for comparison. |
last1 | ending iterator of first object for comparison. |
first2 | beginning iterator of second object for comparison. |
last2 | ending iterator of second object for comparison. |
- Returns
- The boolean value
true
if the range [first1, last1)
is less than the range [first2, last2)
with respect to the recursive path ordering, and false
otherwise.
- Exceptions
- This function is
noexcept
and is guaranteed never to throw.
- Warning
- This function has significantly worse performance than all the variants of shortlex_compare and std::lexicographical_compare.