fix the missing of overloaded non-const of treebox::value/value_ptr

This commit is contained in:
Jinhao 2020-04-18 02:48:13 +08:00
parent cffea79e0f
commit 4dcbb50e1f

View File

@ -300,6 +300,12 @@ namespace nana
return any_cast<T>(&_m_value());
}
template<typename T>
T * value_ptr()
{
return any_cast<T>(&_m_value());
}
template<typename T>
const T& value() const
{
@ -309,6 +315,15 @@ namespace nana
return *p;
}
template<typename T>
T& value()
{
auto p = any_cast<T>(&_m_value());
if (nullptr == p)
throw std::runtime_error("treebox::value<T>() Invalid type of value.");
return *p;
}
template<typename T>
item_proxy & value(T&& t)
{