Quote:Original post by mgarriss
someone should try using this to give boost::any an operator==, something i would love to have.
You can simply do that yourself if really want to:
#include <boost/any.hpp>#include <boost/any.hpp>#include <typeinfo>bool operator==(const boost::any& lhs, const boost::any& rhs) { return lhs.type() == rhs.type();}bool operator==(const boost::any& lhs, const std::type_info& rhs) { return lhs.type() == rhs;}bool operator==(const std::type_info& lhs, const boost::any& rhs) { return rhs == lhs;}
unless i'm missing something, boost::any::type returns a constant reference to std::type_info so its obviously using typeid.