From 632b5d1c4dfb7fb044351e56e69985ef64305fdd Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Fri, 31 Jul 2015 13:21:23 +0200 Subject: C++11: Use = delete instead of private constructors. --- cairomm/context.h | 7 +++---- cairomm/fontface.h | 6 ++---- cairomm/path.h | 8 +++----- cairomm/pattern.h | 7 +++---- cairomm/scaledfont.h | 7 +++---- cairomm/surface.h | 8 ++++---- 6 files changed, 18 insertions(+), 25 deletions(-) diff --git a/cairomm/context.h b/cairomm/context.h index f6b8c29..90e6e7b 100644 --- a/cairomm/context.h +++ b/cairomm/context.h @@ -64,6 +64,9 @@ public: */ explicit Context(cairo_t* cobject, bool has_reference = false); + Context(const Context&) = delete; + Context& operator=(const Context&) = delete; + static RefPtr create(const RefPtr& target); virtual ~Context(); @@ -1609,10 +1612,6 @@ public: protected: cobject* m_cobject; - -private: - Context(const Context&); - Context& operator=(const Context&); }; } // namespace Cairo diff --git a/cairomm/fontface.h b/cairomm/fontface.h index aa0e0cc..909d6bb 100644 --- a/cairomm/fontface.h +++ b/cairomm/fontface.h @@ -58,6 +58,8 @@ public: */ explicit FontFace(cairo_font_face_t* cobject, bool has_reference = false); + FontFace(const FontFace&) = delete; + FontFace& operator=(const FontFace&) = delete; virtual ~FontFace(); @@ -88,10 +90,6 @@ public: protected: cobject* m_cobject; - -private: - FontFace(const FontFace&); - FontFace& operator=(const FontFace&); }; diff --git a/cairomm/path.h b/cairomm/path.h index 28d843f..f168d94 100644 --- a/cairomm/path.h +++ b/cairomm/path.h @@ -40,7 +40,9 @@ class Path public: //Path(); explicit Path(cairo_path_t* cobject, bool take_ownership = false); - //Path(const Path& src); + + Path(const Path&) = delete; + Path& operator=(const Path&) = delete; virtual ~Path(); @@ -63,10 +65,6 @@ public: protected: cobject* m_cobject; - -private: - Path(const Path&); - Path& operator=(const Path&); }; } // namespace Cairo diff --git a/cairomm/pattern.h b/cairomm/pattern.h index 15cac40..dcacd49 100644 --- a/cairomm/pattern.h +++ b/cairomm/pattern.h @@ -56,6 +56,9 @@ public: */ explicit Pattern(cairo_pattern_t* cobject, bool has_reference = false); + Pattern(const Pattern&) = delete; + Pattern& operator=(const Pattern&) = delete; + virtual ~Pattern(); /** @@ -147,10 +150,6 @@ protected: Pattern(); cobject* m_cobject; - -private: - Pattern(const Pattern&); - Pattern& operator=(const Pattern&); }; class SolidPattern : public Pattern diff --git a/cairomm/scaledfont.h b/cairomm/scaledfont.h index b5c8f08..d82b957 100644 --- a/cairomm/scaledfont.h +++ b/cairomm/scaledfont.h @@ -65,6 +65,9 @@ public: */ explicit ScaledFont(cobject* cobj, bool has_reference = false); + ScaledFont(const ScaledFont&) = delete; + ScaledFont& operator=(const ScaledFont&) = delete; + virtual ~ScaledFont(); /** Creates a ScaledFont object from a font face and matrices that describe @@ -227,10 +230,6 @@ protected: const cairo_matrix_t& ctm, const FontOptions& options = FontOptions()); /** The underlying C cairo object that is wrapped by this ScaledFont */ cobject* m_cobject; - -private: - ScaledFont(const ScaledFont&); - ScaledFont& operator=(const ScaledFont&); }; #ifdef CAIRO_HAS_FT_FONT diff --git a/cairomm/surface.h b/cairomm/surface.h index 379742d..c83eb24 100644 --- a/cairomm/surface.h +++ b/cairomm/surface.h @@ -93,6 +93,7 @@ public: * @return the status code of the write operation */ typedef sigc::slot SlotWriteFunc; + /** * This is the type of function which is called when a backend needs to read * data from an input stream. It is passed the buffer to read the data into @@ -115,6 +116,9 @@ public: */ explicit Surface(cairo_surface_t* cobject, bool has_reference = false); + Surface(const Surface&) = delete; + Surface& operator=(const Surface&) = delete; + virtual ~Surface(); /** @@ -410,10 +414,6 @@ protected: /** The underlying C cairo surface type that is wrapped by this Surface */ cobject* m_cobject; - -private: - Surface(const Surface&); - Surface& operator=(const Surface&); }; /** @example image-surface.cc -- cgit v1.2.3