Commit 1f17447f authored by Victor Zverovich's avatar Victor Zverovich

Simplify pad.

parent 6abfb848
...@@ -409,8 +409,8 @@ class StrFormatSpec : public AlignSpec { ...@@ -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) ...@@ -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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment