microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
error.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Jarosław Pelczar <jarek@jpelczar.com>
2//
3// SPDX-License-Identifier: BSD-2-Clause
4
5#pragma once
6
7#include "../microfmt.hpp"
8#include <system_error>
9
10namespace microfmt {
11
12template <> struct formatter<std::error_category> {
13 constexpr void parse(format_parse_context &) noexcept {}
14
15 MICROFMT_API void format(const std::error_category &category, const sink &out) const noexcept;
16};
17
18template <> struct formatter<std::error_code> {
19 constexpr void parse(format_parse_context &) noexcept {}
20
21 MICROFMT_API void format(const std::error_code &ec, const sink &out) const noexcept;
22};
23
24#if MICROFMT_SHARED_PROVIDE_DEFINITIONS
25#include "error.ipp"
26#endif
27
28} // namespace microfmt
Definition microfmt.hpp:881
#define MICROFMT_API
Definition compat.hpp:135
Definition assert.hpp:19
reloco::sink sink
Type-erased, zero-allocation output sink.
Definition microfmt.hpp:46
constexpr void parse(format_parse_context &) noexcept
Definition error.hpp:13
MICROFMT_API void format(const std::error_category &category, const sink &out) const noexcept
constexpr void parse(format_parse_context &) noexcept
Definition error.hpp:19
MICROFMT_API void format(const std::error_code &ec, const sink &out) const noexcept
Definition microfmt.hpp:985