
8 Dec
2004
8 Dec
'04
8:25 p.m.
Yuval Ronen <ronen_yuval <at> yahoo.com> writes:
Hi, I've checked the 'any' library, and I have a suggestion. Wouldn't it be nicer if class any will have a member method like:
template <typename T> T get() const;
or maybe even:
template <typename T> const T& get() const; template <typename T> T& get();
I proposed enhancing any_cast by adding support for extracting reference to the held value some time ago(and it was proposed in the past), but nobody replied to that message. Looks like Boost.Any maintainer's on the vacation. Basic idea was to make this work (now you have to use some obscure syntax): T& object = any_cast<T&>(any_object);