powerd++
0.4.4
|
A formatting wrapper around string literals. More...
#include <utility.hpp>
Public Member Functions | |
constexpr | Formatter (char const *const fmt) |
Construct from string literal. | |
template<typename... ArgTs> | |
std::string | operator() (ArgTs const &... args) const |
Returns a formatted string. More... | |
Private Attributes | |
const char *const | fmt |
Pointer to the string literal. | |
A formatting wrapper around string literals.
Overloads operator (), which treats the string as a printf formatting string, the arguments represent the data to format.
In combination with the literal _fmt, it can be used like this:
BufSize | The buffer size for formatting, resulting strings cannot grow beyond BufSize - 1 |
|
inline |
Returns a formatted string.
ArgTs | Variadic argument types |
args | Variadic arguments |