
Hi, I was wondering why any_cast doesn't return a reference (as boost::get does for boost::variant). To me, it seems to make little sense to supply a any_cast overload with argument any& in addition to const any &, for return-by-value. It also needlessly invokes T's copy ctor, which esp bad if that one throws. Both observations considered, I think the implementation should rather be template <typename T> T & any_cast( any & ); template <typename T> const T & any_cast( const any & ); template <typename T> T * any_cast( any * ); template <typename T> const T * any_cast( const any * ); Don't you agree? Thanks, Marc -- Marc Mutz -- marc@klaralvdalens-datakonsult.se, mutz@kde.org phone: +49 521 521 45 45; mobile: +47 45 27 38 95 Klarälvdalens Datakonsult AB, Platform-independent software solutions