fix an issue that any_cast returns null if value type has cv-specifier

This commit is contained in:
Jinhao 2016-05-19 15:30:07 +08:00
parent a30eef53ec
commit c3611ff2d2

View File

@ -150,7 +150,7 @@ namespace nana
if (!operand) if (!operand)
return nullptr; return nullptr;
auto holder = dynamic_cast<any::holder<Value>*>(operand->content_); auto holder = dynamic_cast<any::holder<typename std::decay<Value>::type>*>(operand->content_);
return (holder ? &holder->value : nullptr); return (holder ? &holder->value : nullptr);
} }