
From: "Yuval Ronen" <ronen_yuval@yahoo.com>
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();
So you'd prefer writing this: boost::any<...> a(...); int i(a.template get<int>()); to this? boost::any<...> a(...); int i(any_cast<int>(a)); The latter has the advantage of looking just like static_cast et al, avoiding the ugly template qualification of the member function invocation, and being shorter. I think the current approach is better. -- Rob Stewart stewart@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;