diff --git a/reference/format/format.md b/reference/format/format.md index 1aabd2faf..cf7c5f0d4 100644 --- a/reference/format/format.md +++ b/reference/format/format.md @@ -510,41 +510,6 @@ int main() [true, false, true] ``` -## 実装例 -```cpp -template -string format(format_string fmt, const Args&... args) -{ - return vformat(fmt.str, make_format_args(args...)); -} - -template -wstring format(wformat_string fmt, const Args&... args) -{ - return vformat(fmt.str, make_wformat_args(args...)); -} - -template -string format(const locale& loc, format_string fmt, const Args&... args) -{ - return vformat(loc, fmt.str, make_format_args(args...)); -} - -template -wstring format(const locale& loc, wformat_string fmt, const Args&... args) -{ - return vformat(loc, fmt.str, make_wformat_args(args...)); -} -``` -* string[link /reference/string/basic_string.md] -* wstring[link /reference/string/basic_string.md] -* format_string[link basic_format_string.md] -* wformat_string[link basic_format_string.md] -* str[italic] -* vformat[link vformat.md] -* make_format_args[link make_format_args.md] -* make_wformat_args[link make_format_args.md] -* locale[link /reference/locale/locale.md] ### ログ出力の例 (C++23) ```cpp @@ -586,6 +551,43 @@ int main() ``` +## 実装例 +```cpp +template +string format(format_string fmt, const Args&... args) +{ + return vformat(fmt.str, make_format_args(args...)); +} + +template +wstring format(wformat_string fmt, const Args&... args) +{ + return vformat(fmt.str, make_wformat_args(args...)); +} + +template +string format(const locale& loc, format_string fmt, const Args&... args) +{ + return vformat(loc, fmt.str, make_format_args(args...)); +} + +template +wstring format(const locale& loc, wformat_string fmt, const Args&... args) +{ + return vformat(loc, fmt.str, make_wformat_args(args...)); +} +``` +* string[link /reference/string/basic_string.md] +* wstring[link /reference/string/basic_string.md] +* format_string[link basic_format_string.md] +* wformat_string[link basic_format_string.md] +* str[italic] +* vformat[link vformat.md] +* make_format_args[link make_format_args.md] +* make_wformat_args[link make_format_args.md] +* locale[link /reference/locale/locale.md] + + ## バージョン ### 言語 - C++20