expression-formatter-inlines.h File
C++ header file with inline implementations for the µTest++ expression formatter. More...
Namespaces Index
Description
C++ header file with inline implementations for the µTest++ expression formatter.
This header provides the inline and template method implementations for expression_formatter. The buffer accessors (str(), c_str(), clear(), empty(), append(), reserve()) are defined as inline functions for zero-overhead access. The template operators — operator<<(T*), operator<<(is_op<T>), operator<<(genuine_integral_value<T>), and operator<<(container) — are instantiated per concrete type at each call site.
The append_number_() helper is also a template, selecting between a std::to_chars path for standard numeric types and an snprintf fallback for long double on platforms where std::to_chars lacks support for 80-bit extended precision.
All definitions reside within the micro_os_plus::micro_test_plus namespace.
This file is intended solely for internal use within the framework and should not be included directly by user code.
File Listing
The file content with the documentation metadata removed is:
44#ifndef MICRO_TEST_PLUS_EXPRESSION_FORMATTER_INLINES_H_
45#define MICRO_TEST_PLUS_EXPRESSION_FORMATTER_INLINES_H_
60#pragma GCC diagnostic push
61#pragma GCC diagnostic ignored "-Waggregate-return"
63#pragma clang diagnostic ignored "-Wc++98-compat"
64#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
103 inline const std::string&
167#pragma GCC diagnostic push
168#if defined(__clang__)
169#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
170#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
183 template <typename T>
193#pragma GCC diagnostic push
194#if defined(__clang__)
195#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
199 snprintf (buff, sizeof (buff), "%p", reinterpret_cast<void*> (v));
202#pragma GCC diagnostic pop
245 expression_formatter::operator<< (const T& t)
249 for (const auto& arg : t)
251 *this << (first ? "" : ", ") << arg;
272 template <class Lhs_T, class Rhs_T>
276 return (*this << colour_ (op) << op.lhs () << " == " << op.rhs ()
292 template <class Lhs_T, class Rhs_T>
296 return (*this << colour_ (op) << op.lhs () << " != " << op.rhs ()
312 template <class Lhs_T, class Rhs_T>
316 return (*this << colour_ (op) << op.lhs () << " > " << op.rhs ()
333 template <class Lhs_T, class Rhs_T>
337 return (*this << colour_ (op) << op.lhs () << " >= " << op.rhs ()
352 template <class Lhs_T, class Rhs_T>
356 return (*this << colour_ (op) << op.lhs () << " < " << op.rhs ()
373 template <class Lhs_T, class Rhs_T>
377 return (*this << colour_ (op) << op.lhs () << " <= " << op.rhs ()
393 template <class Lhs_T, class Rhs_T>
397 return (*this << '(' << op.lhs () << colour_ (op) << " and "
413 template <class Lhs_T, class Rhs_T>
417 return (*this << '(' << op.lhs () << colour_ (op) << " or "
436#if defined(__cpp_exceptions)
449 template <class Callable_T, class Exception_T>
454 return (*this << colour_ (op) << "throws<"
469 template <class Callable_T>
487 template <class Callable_T>
499#pragma GCC diagnostic pop
Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.