mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 18:28:20 +00:00
Variadic version of BasicFormatter's ctor.
This commit is contained in:
parent
383cc773e2
commit
5789930096
9
format.h
9
format.h
@ -36,6 +36,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <initializer_list>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -994,6 +995,14 @@ class BasicFormatter {
|
|||||||
BasicFormatter(BasicWriter<Char> &w, const Char *format = 0)
|
BasicFormatter(BasicWriter<Char> &w, const Char *format = 0)
|
||||||
: writer_(&w), format_(format) {}
|
: writer_(&w), format_(format) {}
|
||||||
|
|
||||||
|
// Constructs a formatter with formatting arguments.
|
||||||
|
BasicFormatter(BasicWriter<Char> &w,
|
||||||
|
const Char *format, std::initializer_list<Arg> args)
|
||||||
|
: writer_(&w), format_(format) {
|
||||||
|
for (const Arg &arg: args)
|
||||||
|
Add(arg);
|
||||||
|
}
|
||||||
|
|
||||||
// Perfoms formatting if the format string is non-null. The format string
|
// Perfoms formatting if the format string is non-null. The format string
|
||||||
// can be null if its ownership has been transferred to another formatter.
|
// can be null if its ownership has been transferred to another formatter.
|
||||||
~BasicFormatter() {
|
~BasicFormatter() {
|
||||||
|
Loading…
Reference in New Issue
Block a user