micro-test-plus 6.0.0
µTest++ Testing Framework
Loading...
Searching...
No Matches
micro_os_plus::micro_test_plus::detail::container_like Concept Reference

Concept satisfied when T provides both begin() and end() member functions returning an iterator and its sentinel. More...

#include <extension.h>

Concept definition

template<class T>
concept container_like = requires (const T& t) {
requires std::input_or_output_iterator<decltype (t.begin ())>;
requires std::sentinel_for<decltype (t.end ()), decltype (t.begin ())>;
}
Concept satisfied when T provides both begin() and end() member functions returning an iterator and i...
Definition extension.h:532

Detailed Description

Template Parameters
TThe type to be checked.

The container_like concept is satisfied when T exposes both a begin() and an end() member function, as required by standard range-based iteration, and begin() returns a std::input_or_output_iterator for which end() returns a std::sentinel_for. The check is part of the concept, so a type whose begin() and end() return something else (void, for example) is not a container, instead of being a hard error where the element type is formed. It is used to detect the ranges that the formatter writes element by element (see formattable_range), and the ranges of values of test_each().

Definition at line 532 of file extension.h.