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 ++++++ wscript | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) 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)); } diff --git a/wscript b/wscript index aa00737..139d439 100644 --- a/wscript +++ b/wscript @@ -9,7 +9,7 @@ from waflib.extras import autowaf # major increment <=> incompatible changes # minor increment <=> compatible changes (additions) # micro increment <=> no interface changes -GANV_VERSION = '1.7.0' +GANV_VERSION = '1.7.1' GANV_MAJOR_VERSION = '1' # Mandatory waf variables -- cgit v1.2.1