micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
Loading...
Searching...
No Matches
Container operators

Overloaded operators to compare containers. More...

Functions

template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator!= (T &&lhs, T &&rhs)
 Non-equality operator for containers.
 
template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator== (T &&lhs, T &&rhs)
 Equality operator for containers.
 

Detailed Description

Overloaded operators to compare containers.

In addition to the generic operators, there are also equality operators for containers.

Examples
#include <string_view>
using namespace std::literals; // For the "sv" literal.
// ...
mt::test_case ("Operators", [] {
using namespace micro_test_plus::operators;
mt::expect (std::vector<int>{ 1, 2 } == std::vector<int>{ 1, 2 })
<< "vector{ 1, 2 } == vector{ 1, 2 }";
mt::expect (std::vector<int>{ 1, 2, 3 } != std::vector<int>{ 1, 2, 4 })
<< "vector{ 1, 2, 3 } != vector{ 1, 2, 4 }";
});

Function Documentation

◆ operator!=()

template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator!= ( T && lhs,
T && rhs )
constexpr

Non-equality operator for containers.

Definition at line 541 of file micro-test-plus.h.

◆ operator==()

template<class T , type_traits::requires_t< type_traits::is_container_v< T > > = 0>
constexpr auto micro_os_plus::micro_test_plus::operators::operator== ( T && lhs,
T && rhs )
constexpr

Equality operator for containers.

Definition at line 529 of file micro-test-plus.h.