From a92b3e4274a183fe85015530b208ef9e2d88e47a Mon Sep 17 00:00:00 2001 From: Leonardo Backes Vargas Date: Sun, 28 May 2017 12:16:26 -0300 Subject: [PATCH] Fix constness on const functions with nana::any and related casts. --- include/nana/gui/widgets/listbox.hpp | 2 +- include/nana/gui/widgets/tabbar.hpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index f3cc09df..552b2e36 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -893,7 +893,7 @@ namespace nana } template - T* value_ptr() const + T const * value_ptr() const { return any_cast(_m_value()); } diff --git a/include/nana/gui/widgets/tabbar.hpp b/include/nana/gui/widgets/tabbar.hpp index f22e6e5c..0e2e2e9c 100644 --- a/include/nana/gui/widgets/tabbar.hpp +++ b/include/nana/gui/widgets/tabbar.hpp @@ -237,9 +237,9 @@ namespace nana return this->get_drawer_trigger().activated(); } - value_type & at(std::size_t pos) const /// Returns pos'th element + value_type const & at(std::size_t pos) const /// Returns pos'th element { - return static_cast(this->get_drawer_trigger().at(pos)); + return any_cast(this->get_drawer_trigger().at(pos)); } void close_fly(bool fly) /// Draw or not a close button in each tab.