mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +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_;
|
const T *str_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StrFormatSpec(const T *str, const AlignSpec &spec)
|
StrFormatSpec(const T *str, unsigned width, wchar_t fill)
|
||||||
: AlignSpec(spec), str_(str) {}
|
: AlignSpec(width, fill), str_(str) {}
|
||||||
|
|
||||||
const T *str() const { return str_; }
|
const T *str() const { return str_; }
|
||||||
};
|
};
|
||||||
@ -507,12 +507,12 @@ DEFINE_INT_FORMATTERS(unsigned long long)
|
|||||||
template <typename Char>
|
template <typename Char>
|
||||||
inline StrFormatSpec<Char> pad(
|
inline StrFormatSpec<Char> pad(
|
||||||
const Char *str, unsigned width, Char fill = ' ') {
|
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(
|
inline StrFormatSpec<wchar_t> pad(
|
||||||
const wchar_t *str, unsigned width, char fill = ' ') {
|
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>
|
template <typename Char>
|
||||||
|
Loading…
Reference in New Issue
Block a user