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 "-Wunknown-warning-option"
64#pragma clang diagnostic ignored "-Wc++98-compat"
65#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
104 inline const std::string&
168#pragma GCC diagnostic push
169#if defined(__clang__)
170#pragma clang diagnostic ignored "-Wunsafe-buffer-usage"
171#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
184 template <typename T>
194#pragma GCC diagnostic push
195#if defined(__clang__)
196#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
200 snprintf (buff, sizeof (buff), "%p", reinterpret_cast<void*> (v));
203#pragma GCC diagnostic pop
246 expression_formatter::operator<< (const T& t)
250 for (const auto& arg : t)
252 *this << (first ? "" : ", ") << arg;
273 template <class Lhs_T, class Rhs_T>
277 return (*this << colour_ (op) << op.lhs () << " == " << op.rhs ()
293 template <class Lhs_T, class Rhs_T>
297 return (*this << colour_ (op) << op.lhs () << " != " << op.rhs ()
313 template <class Lhs_T, class Rhs_T>
317 return (*this << colour_ (op) << op.lhs () << " > " << op.rhs ()
334 template <class Lhs_T, class Rhs_T>
338 return (*this << colour_ (op) << op.lhs () << " >= " << op.rhs ()
353 template <class Lhs_T, class Rhs_T>
357 return (*this << colour_ (op) << op.lhs () << " < " << op.rhs ()
374 template <class Lhs_T, class Rhs_T>
378 return (*this << colour_ (op) << op.lhs () << " <= " << op.rhs ()
394 template <class Lhs_T, class Rhs_T>
398 return (*this << '(' << op.lhs () << colour_ (op) << " and "
414 template <class Lhs_T, class Rhs_T>
418 return (*this << '(' << op.lhs () << colour_ (op) << " or "
437#if defined(__cpp_exceptions)
450 template <class Callable_T, class Exception_T>
455 return (*this << colour_ (op) << "throws<"
470 template <class Callable_T>
488 template <class Callable_T>
500#pragma GCC diagnostic pop
Generated via doxygen2docusaurus 2.2.1 by Doxygen 1.17.0.