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) {