This struct enables the use of C++20 function std::format - and with that any adaption of custom types - to be directly appendable to class TAString, without the need of creating an intermediate temporary std::string.
For that, this struct stores the format string and a tuple of decayed formatting arguments. With a corresponding specialization of struct AppendableTraits, the formatted output is produced using C++20's std::vformat_to and a std::back_insert_iterator that appends characters directly to an AString.
char and wchar_t. With that, the specializations of AppendableTraits are likewise only defined for these concrete character types. If you compile ALib to switch the default character type, for example, by using configuration macro ALIB_CHARACTERS_SIZEOF_WCHAR to change the default size (which is defined by the compiler !), then appending this type TStdFormat might not be available.| TChar | The character type of the TAString and the format string. |
| TArgs | Variadic template parameters representing the types of the formatting arguments. |
Definition at line 311 of file ALib.Strings.StdFormatter.H.
#include <ALib.Strings.StdFormatter.H>
Public Field Index: | |
| std::tuple< std::decay_t< TArgs >... > | arguments |
The variadic arguments given construction. Will be passed to std::format. | |
| TString< TChar > | format |
The format string given construction. Will be passed to std::format. | |
Public Method Index: | |
| TStdFormat (const TString< TChar > &formatString, TArgs &&... args) | |
| std::tuple<std::decay_t<TArgs>...> alib::strings::APPENDABLES::TStdFormat< TChar, TArgs >::arguments |
The variadic arguments given construction. Will be passed to std::format.
Definition at line 316 of file ALib.Strings.StdFormatter.H.
| TString<TChar> alib::strings::APPENDABLES::TStdFormat< TChar, TArgs >::format |
The format string given construction. Will be passed to std::format.
Definition at line 313 of file ALib.Strings.StdFormatter.H.
|
inline |
Constructor. Uses perfect forwarding and stores decayed copies of the arguments.
Definition at line 321 of file ALib.Strings.StdFormatter.H.