From 6f3c095ed646fad6a6e0f24c672cd638d7ce219e Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 3 Dec 2014 06:16:52 -0800 Subject: [PATCH] Use FMT_DISALLOW_COPY_AND_ASSIGN instead of undefined assignment operators --- format.cc | 15 ++++++++------- format.h | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/format.cc b/format.cc index fc414fac..dfcaebc8 100644 --- a/format.cc +++ b/format.cc @@ -240,10 +240,10 @@ void check_sign(const Char *&s, const Arg &arg) { // left alignment if it is negative. class WidthHandler : public fmt::internal::ArgVisitor { private: - WidthHandler& operator=(WidthHandler const&); //no impl - fmt::FormatSpec &spec_; + FMT_DISALLOW_COPY_AND_ASSIGN(WidthHandler); + public: explicit WidthHandler(fmt::FormatSpec &spec) : spec_(spec) {} @@ -286,11 +286,11 @@ class PrecisionHandler : template class ArgConverter : public fmt::internal::ArgVisitor, void> { private: - ArgConverter& operator=(ArgConverter const&); //no impl - fmt::internal::Arg &arg_; wchar_t type_; + FMT_DISALLOW_COPY_AND_ASSIGN(ArgConverter); + public: ArgConverter(fmt::internal::Arg &arg, wchar_t type) : arg_(arg), type_(type) {} @@ -326,9 +326,10 @@ class ArgConverter : public fmt::internal::ArgVisitor, void> { // Converts an integer argument to char for printf. class CharConverter : public fmt::internal::ArgVisitor { private: - CharConverter& operator=(CharConverter const&); // no impl fmt::internal::Arg &arg_; + FMT_DISALLOW_COPY_AND_ASSIGN(CharConverter); + public: explicit CharConverter(fmt::internal::Arg &arg) : arg_(arg) {} @@ -531,13 +532,13 @@ template class fmt::internal::ArgFormatter : public fmt::internal::ArgVisitor, void> { private: - ArgFormatter& operator=(ArgFormatter const&); // no impl - fmt::BasicFormatter &formatter_; fmt::BasicWriter &writer_; fmt::FormatSpec &spec_; const Char *format_; + FMT_DISALLOW_COPY_AND_ASSIGN(ArgFormatter); + public: ArgFormatter( fmt::BasicFormatter &f,fmt::FormatSpec &s, const Char *fmt) diff --git a/format.h b/format.h index 4fd237fd..c3e66d1a 100644 --- a/format.h +++ b/format.h @@ -991,10 +991,10 @@ class PrintfFormatter : private FormatterBase { template class BasicFormatter : private internal::FormatterBase { private: - BasicFormatter& operator=(BasicFormatter const&); // no impl - BasicWriter &writer_; const Char *start_; + + FMT_DISALLOW_COPY_AND_ASSIGN(BasicFormatter); // Parses argument index and returns corresponding argument. internal::Arg parse_arg_index(const Char *&s);