The Container Operators Reference
Overloaded operators for container comparison. More...
Functions Index
constexpr auto | operator!= (T &&lhs, T &&rhs) |
Non-equality operator for containers. More... | |
constexpr auto | operator== (T &&lhs, T &&rhs) |
Equality operator for containers. More... | |
Description
Overloaded operators for container comparison.
The µTest++ framework provides overloaded operators to facilitate direct and expressive comparison of standard containers, such as vectors and strings, within test cases. These operators enable developers to write clear and concise assertions when verifying the equality or inequality of container contents.
In addition to the generic operators, specialised equality and inequality operators are provided for containers, ensuring accurate and efficient comparison semantics that align with modern C++ practices.
- Examples
Functions
operator!=()
| nodiscardconstexpr |
Non-equality operator for containers.
- Template Parameters
T The container type, constrained to recognised container types.
- Parameters
[in] lhs The left hand side container operand. [in] rhs The right hand side container operand.
- Returns
A comparator object that evaluates to true if the containers are not equal.
This overload of the non-equality operator enables direct comparison of two container objects within the µTest++ framework. It constructs a comparator object that can be used in test expectations and assertions to verify that two containers are not equal in content or order.
The operator is enabled only for types recognised as containers by the framework's type traits.
Definition at line 205 of file operators.h.
operator==()
| nodiscardconstexpr |
Equality operator for containers.
- Template Parameters
T The container type, constrained to recognised container types.
- Parameters
[in] lhs The left hand side container operand. [in] rhs The right hand side container operand.
- Returns
A comparator object that evaluates to true if the containers are equal.
This overload of the equality operator enables direct comparison of two container objects within the µTest++ framework. It constructs a comparator object that can be used in test expectations and assertions to verify that two containers are equal in content and order.
The operator is enabled only for types recognised as containers by the framework's type traits.
Definition at line 177 of file operators.h.
Generated via docusaurus-plugin-doxygen by Doxygen 1.14.0.