mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 00:21:13 +00:00
Simplify pad.
This commit is contained in:
parent
6abfb84808
commit
1f17447fac
8
format.h
8
format.h
@ -409,8 +409,8 @@ class StrFormatSpec : public AlignSpec {
|
||||
const T *str_;
|
||||
|
||||
public:
|
||||
StrFormatSpec(const T *str, const AlignSpec &spec)
|
||||
: AlignSpec(spec), str_(str) {}
|
||||
StrFormatSpec(const T *str, unsigned width, wchar_t fill)
|
||||
: AlignSpec(width, fill), str_(str) {}
|
||||
|
||||
const T *str() const { return str_; }
|
||||
};
|
||||
@ -507,12 +507,12 @@ DEFINE_INT_FORMATTERS(unsigned long long)
|
||||
template <typename Char>
|
||||
inline StrFormatSpec<Char> pad(
|
||||
const Char *str, unsigned width, Char fill = ' ') {
|
||||
return StrFormatSpec<Char>(str, AlignSpec(width, fill));
|
||||
return StrFormatSpec<Char>(str, width, fill);
|
||||
}
|
||||
|
||||
inline StrFormatSpec<wchar_t> pad(
|
||||
const wchar_t *str, unsigned width, char fill = ' ') {
|
||||
return StrFormatSpec<wchar_t>(str, AlignSpec(width, fill));
|
||||
return StrFormatSpec<wchar_t>(str, width, fill);
|
||||
}
|
||||
|
||||
template <typename Char>
|
||||
|
Loading…
Reference in New Issue
Block a user