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

Concept satisfied when a type can be appended to the message of a check result via operator<<. More...

#include <extension.h>

Concept definition

template<class T>
concept printable = requires (detail::expression_formatter& formatter,
const T& value) { formatter << value; }
Formats values and expressions into an owned string buffer.
Concept satisfied when a type can be appended to the message of a check result via operator<<.
Definition extension.h:433

Detailed Description

Template Parameters
TThe type to be checked.

The printable concept is satisfied when a value of type T can be written to an expression_formatter, so the message of a check accepts the same values as the operands of the comparators: the strings, the characters, the arithmetic types, std::nullptr_t, the pointers, the containers, the scoped enumerations, the pairs, the tuples, the optionals, the value wrappers, and the application types with an operator<< for the formatter, found by argument-dependent lookup. It constrains the operator<< overload of check_result, which also accepts the callable objects that return a printable value, called only if the check fails; an application helper that forwards a value to the message uses it for the same constraint.

The formatter is only declared here; the concept is checked where it is used, after expression-formatter.h was included.

Definition at line 433 of file extension.h.