c++ - set insert problem -


Why is the following program not working? How can I fix this?

  #include & lt; Iostream & gt; # Include & lt; Set & gt; using namespace std; Class K {Private: Long A; }; Int main () {Kashmir A; Set up & lt; K & gt; B; B.insert (a); Return 0; }    

A sort of elements are required; Can compare your elements.

Either a operator for its class operator Add or add another template argument. Comparative determines the order between the two of examples for a set class.

Overloading operator is straightforward:

  BULL operator & lt; (K const & x, K const & y) {return xa & lt; Y.a; }   

This would mean that an example of K is less than the other if only its member one is less than the other ?? ?? S

Comments