String Operators
Overloaded operators for string comparison. More...
Operators Index
| constexpr auto | operator!= (std::string_view lhs, std::string_view rhs) |
|
Non-equality operator for string_view objects. More... | |
| constexpr auto | operator== (std::string_view lhs, std::string_view rhs) |
|
Equality operator for string_view objects. More... | |
Description
Overloaded operators for string comparison.
Operators are provided specifically for comparing string types, such as std::string_view. These operators enable clear, expressive assertions when verifying string values in test cases, supporting both equality and inequality checks.
Using these dedicated operators ensures concise, readable tests that accurately reflect intended logic. The framework ensures correct string comparisons and reports failed checks with both actual and expected values for clear diagnostics.
- Examples
Operators
operator!=()
| nodiscard constexpr |
Non-equality operator for string_view objects.
Constructs an ne_ comparator object from the two string_view operands and returns it. The comparator evaluates to true if the string views are not equal.
- Parameters
-
[in] lhs The left hand side std::string_view operand.
[in] rhs The right hand side std::string_view operand.
- Returns
A comparator object that evaluates to true if the string views are not equal.
Definition at line 88 of file operators-inlines.h.
operator==()
| nodiscard constexpr |
Equality operator for string_view objects.
Constructs an eq_ comparator object from the two string_view operands and returns it. The comparator evaluates to true if the string views are equal.
- Parameters
-
[in] lhs The left hand side std::string_view operand.
[in] rhs The right hand side std::string_view operand.
- Returns
A comparator object that evaluates to true if the string views are equal.
Definition at line 76 of file operators-inlines.h.
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.