diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-04-22 13:19:46 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-04-22 13:19:46 +0100 |
| commit | f6c7948c12455c55f19ac27f328478b486f8098e (patch) | |
| tree | 204e1d60e1486031a5818e7738b73d070ef853b6 /src/string.hh | |
| parent | 8ff63198bca86e00d8572d27d04321a3aefa5f73 (diff) | |
Add format_to allowing formating to an existing buffer
Diffstat (limited to 'src/string.hh')
| -rw-r--r-- | src/string.hh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/string.hh b/src/string.hh index a6a267cb..da235744 100644 --- a/src/string.hh +++ b/src/string.hh @@ -311,6 +311,14 @@ String format(StringView fmt, Types... params) return format(fmt, ArrayView<const StringView>{detail::format_param(params)...}); } +StringView format_to(ArrayView<char> buffer, StringView fmt, ArrayView<const StringView> params); + +template<typename... Types> +StringView format_to(ArrayView<char> buffer, StringView fmt, Types... params) +{ + return format_to(buffer, fmt, ArrayView<const StringView>{detail::format_param(params)...}); +} + } #endif // string_hh_INCLUDED |
