From 2c17463cce43e5d9d846072e6a7d03f58760a607 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Nov 2020 19:15:49 +0100 Subject: Use modern noncopyable pattern --- ganv/Canvas.hpp | 12 ++++++++---- ganv/Item.hpp | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'ganv') diff --git a/ganv/Canvas.hpp b/ganv/Canvas.hpp index eaf08fd..a862ae3 100644 --- a/ganv/Canvas.hpp +++ b/ganv/Canvas.hpp @@ -52,7 +52,14 @@ class Canvas { public: Canvas(double width, double height); - virtual ~Canvas(); + + Canvas(const Canvas&) = delete; + Canvas& operator=(const Canvas&) = delete; + + Canvas(Canvas&&) = delete; + Canvas& operator=(Canvas&&) = delete; + + virtual ~Canvas(); GanvItem* root() { return ganv_canvas_root(gobj()); } @@ -138,9 +145,6 @@ public: sigc::signal signal_disconnect; private: - Canvas(const Canvas&); ///< Noncopyable - const Canvas& operator=(const Canvas&); ///< Noncopyable - GanvCanvas* const _gobj; }; diff --git a/ganv/Item.hpp b/ganv/Item.hpp index fcb98ef..8f0f9c2 100644 --- a/ganv/Item.hpp +++ b/ganv/Item.hpp @@ -47,6 +47,12 @@ public: } } + Item(const Item&) = delete; + Item& operator=(const Item&) = delete; + + Item(Item&&) = delete; + Item& operator=(Item&&) = delete; + virtual ~Item() { gtk_object_destroy(GTK_OBJECT(_gobj)); } -- cgit v1.2.1