4#if __cplusplus >= 202002L
22 template <
typename... Args>
23 Format(
const char* fmt, Args... args) {
31 operator const char*() {
return buffer_.
c_str(); }
37 void parse(
const char* fmt) {
38 while (*fmt !=
'\0') {
40 if (*fmt ==
'{' && *(fmt + 1) ==
'{') {
45 if (*fmt ==
'}' && *(fmt + 1) ==
'}') {
55 template <
typename T,
typename... Args>
56 void parse(
const char* fmt, T head_value, Args... tail_args) {
57 while (*fmt !=
'\0') {
59 if (*fmt ==
'{' && *(fmt + 1) ==
'}') {
60 buffer_ += head_value;
61 parse(fmt + 2, tail_args...);
65 if (*fmt ==
'{' && *(fmt + 1) ==
'{') {
70 if (*fmt ==
'}' && *(fmt + 1) ==
'}') {
Definition InitializerList.h:7