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_OS_PLUS_MICRO_TEST_PLUS_INLINES_EXPRESSION_FORMATTER_INLINES_H_
45#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_EXPRESSION_FORMATTER_INLINES_H_
49#if defined(__cplusplus)
60#pragma GCC diagnostic push
62#pragma GCC diagnostic ignored "-Waggregate-return"
64#pragma clang diagnostic ignored "-Wunknown-warning-option"
65#pragma clang diagnostic ignored "-Wc++98-compat"
66#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
105 inline const std::string&
175 template <typename T>
186#pragma GCC diagnostic push
188#if defined(__clang__)
189#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
194 snprintf (buff, sizeof (buff), "%p", reinterpret_cast<void*> (v));
198#pragma GCC diagnostic pop
242 expression_formatter::operator<< (const T& t)
246 for (const auto& arg : t)
248 *this << (first ? "" : ", ") << arg;
269 template <class Lhs_T, class Rhs_T>
273 return (*this << colour_ (op) << op.lhs () << " == " << op.rhs ()
289 template <class Lhs_T, class Rhs_T>
293 return (*this << colour_ (op) << op.lhs () << " != " << op.rhs ()
309 template <class Lhs_T, class Rhs_T>
313 return (*this << colour_ (op) << op.lhs () << " > " << op.rhs ()
330 template <class Lhs_T, class Rhs_T>
334 return (*this << colour_ (op) << op.lhs () << " >= " << op.rhs ()
349 template <class Lhs_T, class Rhs_T>
353 return (*this << colour_ (op) << op.lhs () << " < " << op.rhs ()
370 template <class Lhs_T, class Rhs_T>
374 return (*this << colour_ (op) << op.lhs () << " <= " << op.rhs ()
390 template <class Lhs_T, class Rhs_T>
394 return (*this << '(' << op.lhs () << colour_ (op) << " and "
410 template <class Lhs_T, class Rhs_T>
414 return (*this << '(' << op.lhs () << colour_ (op) << " or "
433#if defined(__cpp_exceptions)
446 template <class Callable_T, class Exception_T>
451 return (*this << colour_ (op) << "throws<"
466 template <class Callable_T>
484 template <class Callable_T>
496#pragma GCC diagnostic pop
Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.17.0.