From 4dcbb50e1f5ba48eef6f4aa805e861aad80d2cb6 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sat, 18 Apr 2020 02:48:13 +0800 Subject: [PATCH] fix the missing of overloaded non-const of treebox::value/value_ptr --- include/nana/gui/widgets/treebox.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/nana/gui/widgets/treebox.hpp b/include/nana/gui/widgets/treebox.hpp index eaae22e5..a6342404 100644 --- a/include/nana/gui/widgets/treebox.hpp +++ b/include/nana/gui/widgets/treebox.hpp @@ -300,6 +300,12 @@ namespace nana return any_cast(&_m_value()); } + template + T * value_ptr() + { + return any_cast(&_m_value()); + } + template const T& value() const { @@ -309,6 +315,15 @@ namespace nana return *p; } + template + T& value() + { + auto p = any_cast(&_m_value()); + if (nullptr == p) + throw std::runtime_error("treebox::value() Invalid type of value."); + return *p; + } + template item_proxy & value(T&& t) {