diff --git a/include/nana/gui/widgets/checkbox.hpp b/include/nana/gui/widgets/checkbox.hpp index 8d06b590..e3b31d69 100644 --- a/include/nana/gui/widgets/checkbox.hpp +++ b/include/nana/gui/widgets/checkbox.hpp @@ -1,7 +1,7 @@ /** * A CheckBox Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -100,6 +100,7 @@ namespace drawerbase event_handle eh_keyboard; }; public: + constexpr static const std::size_t npos = static_cast(-1); ~radio_group(); void add(checkbox&); std::size_t checked() const; ///< Retrieves the index of the checkbox which is checked. diff --git a/include/nana/gui/widgets/group.hpp b/include/nana/gui/widgets/group.hpp index 2e264289..1985c961 100644 --- a/include/nana/gui/widgets/group.hpp +++ b/include/nana/gui/widgets/group.hpp @@ -1,7 +1,7 @@ /** * A group widget implementation * Nana C++ Library(http://www.nanaro.org) - * Copyright(C) 2015 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2015-2018 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -28,6 +28,7 @@ namespace nana{ struct implement; public: using field_reference = place::field_reference; + constexpr static const std::size_t npos = static_cast(-1); /// The default construction group(); @@ -63,8 +64,8 @@ namespace nana{ group& enable_format_caption(bool format); - group& collocate() throw(); - group& div(const char* div_str) throw(); + group& collocate() noexcept; + group& div(const char* div_str) noexcept; field_reference operator[](const char* field); template diff --git a/source/gui/widgets/checkbox.cpp b/source/gui/widgets/checkbox.cpp index a1b2fe5c..7fc20469 100644 --- a/source/gui/widgets/checkbox.cpp +++ b/source/gui/widgets/checkbox.cpp @@ -1,7 +1,7 @@ /* * A CheckBox Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -296,7 +296,7 @@ namespace nana{ namespace drawerbase return static_cast(i - ui_container_.cbegin()); } - return ui_container_.size(); + return npos; } std::size_t radio_group::size() const diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp index 87d2ebc6..f84058ea 100644 --- a/source/gui/widgets/group.cpp +++ b/source/gui/widgets/group.cpp @@ -1,7 +1,7 @@ /** * A group widget implementation * Nana C++ Library(http://www.nanaro.org) - * Copyright(C) 2015-2017 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2015-2018 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -172,13 +172,13 @@ namespace nana{ return *this; } - group& group::collocate() throw () + group& group::collocate() noexcept { impl_->place_content.collocate(); return *this; } - group& group::div(const char* div_str) throw () + group& group::div(const char* div_str) noexcept { if (div_str) impl_->usr_div_str = div_str;