ZeroErr
载入中...
搜索中...
未找到
format.h
浏览该文件的文档.
1#pragma once
2#include "zeroerr/print.h"
3
4#include "zeroerr/string.h"
5#include <utility>
6
7namespace zeroerr {
8
9
26template <typename... T>
27ZEROERR_DIAGNOSTIC_NOINLINE zeroerr::String format(const char* fmt, T&&... args) {
28 // The sentinel keeps the array valid for an empty parameter pack.
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
Definition string.h:41
zeroerr::String formatText(const char *fmt, const DiagnosticValue *values, std::size_t count, std::size_t *ends)
Definition text.cpp:83
DiagnosticValue makeDiagnosticValue(T &value)
Definition print.h:346
Definition assert_text.cpp:5
ZEROERR_DIAGNOSTIC_NOINLINE zeroerr::String format(const char *fmt, T &&... args)
Format a string with arguments
Definition format.h:27
#define ZEROERR_DIAGNOSTIC_NOINLINE
Definition text.h:15