ZeroErr
中/En
载入中...
搜索中...
未找到
format.h
浏览该文件的文档.
1
#pragma once
2
#include "
zeroerr/print.h
"
3
4
#include "
zeroerr/string.h
"
5
#include <utility>
6
7
namespace
zeroerr
{
8
9
26
template
<
typename
... T>
27
ZEROERR_DIAGNOSTIC_NOINLINE
zeroerr::String
format
(
const
char
* fmt, T&&... args) {
28
// The sentinel keeps the array valid for an empty parameter pack.
29
const
detail::DiagnosticValue
values[] = {
detail::makeDiagnosticValue
(args)...,
30
{
nullptr
,
nullptr
}};
31
std::size_t ends[
sizeof
...(T) + 1];
32
return
detail::formatText
(fmt, values,
sizeof
...(T), ends);
33
}
34
35
}
// namespace zeroerr
zeroerr::String
Definition
string.h:41
zeroerr::detail::formatText
zeroerr::String formatText(const char *fmt, const DiagnosticValue *values, std::size_t count, std::size_t *ends)
Definition
text.cpp:83
zeroerr::detail::makeDiagnosticValue
DiagnosticValue makeDiagnosticValue(T &value)
Definition
print.h:346
zeroerr
Definition
assert_text.cpp:5
zeroerr::format
ZEROERR_DIAGNOSTIC_NOINLINE zeroerr::String format(const char *fmt, T &&... args)
Format a string with arguments
Definition
format.h:27
print.h
string.h
zeroerr::detail::DiagnosticValue
Definition
text.h:51
ZEROERR_DIAGNOSTIC_NOINLINE
#define ZEROERR_DIAGNOSTIC_NOINLINE
Definition
text.h:15
include
zeroerr
format.h
制作者
1.9.8