
Is it possible to have std::find compare the class that the shared_ptr is pointing too? I have a list of shared_ptr of a class called FundamentalTypes. The class has it's own operator==. I'd like to search the list with std::find using the class's operator==. I've included the class with the key elements I'm referring too. Ryan class FundamentalTypes { public: FundamentalTypes(std::string const& name) : m_name(name) bool operator==(FundamentalTypes const& rhs) { return (rhs.m_name == m_name) ? true : false; } std::string m_name; }; template<typename T> class Type : public FundamentalTypes { Type(std::string const& name) : FundamentalTypes(name) }; //main typedef shared_ptr<FundamentalTypes> sharedTypes typedef std::list<sharedTypes> TypesList sharedTypes value = sharedTypes(new Type<short>("bob")); TypesList m_list; TypesList::iterator itor = std::find(m_list.begin(), m_list.end(), value);