From 28e9bb8a7d04ec173168a50553348c4e08cd4b6f Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sat, 30 Sep 2017 07:19:15 +0800 Subject: [PATCH] fix some legacy issues --- include/nana/paint/graphics.hpp | 4 ++-- source/paint/graphics.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/nana/paint/graphics.hpp b/include/nana/paint/graphics.hpp index 7d6d6df8..9ce35704 100644 --- a/include/nana/paint/graphics.hpp +++ b/include/nana/paint/graphics.hpp @@ -85,13 +85,13 @@ namespace nana bool changed() const; ///< Returns true if the graphics object is operated bool empty() const; ///< Returns true if the graphics object does not refer to any resource. - operator const void*() const; + explicit operator bool() const noexcept; drawable_type handle() const; const void* pixmap() const; const void* context() const; - void swap(graphics& other); + void swap(graphics& other) noexcept; /// Creates a graphics/drawable resource /** diff --git a/source/paint/graphics.cpp b/source/paint/graphics.cpp index a048423c..00cb26de 100644 --- a/source/paint/graphics.cpp +++ b/source/paint/graphics.cpp @@ -269,7 +269,7 @@ namespace paint return (!impl_->handle); } - graphics::operator const void *() const + graphics::operator bool() const { return impl_->handle; }