From 4327ec49a7b3296f3865065f141809ba46d51fd3 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sun, 20 Nov 2016 12:04:30 +0800 Subject: [PATCH] add noexcept to some functions --- include/nana/basic_types.hpp | 4 ++-- include/nana/key_type.hpp | 10 +++++----- source/basic_types.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/nana/basic_types.hpp b/include/nana/basic_types.hpp index 6ddb6912..4f230fc0 100644 --- a/include/nana/basic_types.hpp +++ b/include/nana/basic_types.hpp @@ -457,8 +457,8 @@ namespace nana rectangle& pare_off(int pixels); ///same_type(right) && (left->compare(right) == false) && (right->compare(left) == false)); } @@ -104,12 +104,12 @@ namespace nana } public: //implement key_interface methods - bool same_type(const key_interface * p) const override + bool same_type(const key_interface * p) const noexcept override { return (nullptr != dynamic_cast(p)); } - bool compare(const key_interface* p) const override + bool compare(const key_interface* p) const noexcept override { auto rhs = dynamic_cast(p); return rhs && compare_(key_object_, rhs->key_object_); diff --git a/source/basic_types.cpp b/source/basic_types.cpp index 6a40ee59..0523a3c0 100644 --- a/source/basic_types.cpp +++ b/source/basic_types.cpp @@ -649,12 +649,12 @@ namespace nana return *this; } - int rectangle::right() const + int rectangle::right() const noexcept { return x + static_cast(width); } - int rectangle::bottom() const + int rectangle::bottom() const noexcept { return y + static_cast(height); }