   std::find hates me
  I am having a problem with std::find. Here is the revelant code:class Card{ public: Suit getsuit(); int getvalue(); Card(Suit s,int v):value(v),suit(s){}  private: Suit suit; int value;};and here is the part that I am having troubles with:bool Hand::contains(Card c) //cards is a vector of Cards{ return find(cards.begin(),cards.end(),Card(c))!=cards.end();}I am getting these errors:C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h: In function `_RandomAccessIterator std::find(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, std::random_access_iterator_tag) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Card*, std::vector<Card, std::allocator<Card> > >, _Tp = Card]':C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:314:   instantiated from `_InputIterator std::find(_InputIterator, _InputIterator, const _Tp&) [with _InputIterator = __gnu_cxx::__normal_iterator<Card*, std::vector<Card, std::allocator<Card> > >, _Tp = Card]'card.cpp:31:   instantiated from hereC:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:207: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __val'C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:211: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __val'C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:215: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __val'C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:219: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __val'C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:227: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __val'C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:231: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __val'C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:235: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __val'C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h: In function `_OutputIterator std::remove_copy(_InputIterator, _InputIterator, _OutputIterator, const _Tp&) [with _InputIterator = __gnu_cxx::__normal_iterator<Card*, std::vector<Card, std::allocator<Card> > >, _OutputIterator = __gnu_cxx::__normal_iterator<Card*, std::vector<Card, std::allocator<Card> > >, _Tp = Card]':C:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:1114:   instantiated from `_ForwardIterator std::remove(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = __gnu_cxx::__normal_iterator<Card*, std::vector<Card, std::allocator<Card> > >, _Tp = Card]'card.cpp:45:   instantiated from hereC:/Dev-Cpp/include/c++/3.4.2/bits/stl_algo.h:1037: error: no match for 'operator==' in '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = Card*, _Container = std::vector<Card, std::allocator<Card> >]() == __value'How can I fix this?   
  Add an == operator to your Card class, otherwise the compiler can't know how to compare two cards.   ;  You probably also need operator< if you are planning on sorting cards.   ;  Thanks, it worked!   