C++ Errors while using <set>
<p>I kept geting instantiated errors. Try fixing it, no matter what, I can't seem to implement SET. Tried using vectors but I have no idea how to implement an equality operator properly and failed too.</p>

<p>At first I was using vectors but it was hard to use while trying to keep x and y values unique. Meaning, I would read a text file of data.
Point1, [3, 10]
Point2, [10, 10]</p>

<p>So Point 1 will go to different vector from Point 2 and then storing the data seperately. But somehow, in the text file there are repeat values of Point1, [3, 10]. I do not want to inset another same record and want them to be unique. So i tried using set but I could not really insert in the data.</p>

<p>Errors are:
In member function 'bool std::les&lt;_Tp>::operator()(const _Tp&amp;, const _Tp&amp;) const [with _Tp = Point]':
STL_TREE.h:980: instantiated from 'std::pair::iterator, bool> std::_Rb_tree&lt;_Key,....
STL_SET.h:307: instantiated from 'std::pair, _Compare, typename _Alloc::rebind&lt;_Key>::other>::const_interator, bool> std::set.....
main.cpp:141: instantiated from here
stl_function.h:227: error: no match for 'operator&lt;' in '_<em>x &lt;</em>_y'</p>

<p>Point.h</p>

<pre><code>#ifndef POINT_H
#define POINT_H 

#include &lt;iostream&gt;
#include &lt;ostream&gt;
#include &lt;fstream&gt;
#include &lt;sstream&gt;
#include &lt;vector&gt;
#include &lt;math.h&gt;
#include &lt;set&gt;
#include &lt;string.h&gt;
#include &lt;string&gt;
#include &lt;stdio.h&gt;

using namespace std;

class Point
{
    friend ostream&amp; operator&lt;&lt;(ostream&amp;, const Point&amp;);

    protected:
        int x, y;

    public:
        //c'tor
        Point(int xx, int yy);

        //setters
        void setX(int x1);
        void setY(int y1);

        //getters
        int getX() const {return x;};
        int getY() const {return y;};
};

Point::Point(int xx, int yy) : x(xx), y(yy)
{

}

void Point::setX(int x1)
{
    x=x1;
}

void Point::setY(int y1)
{
    y=y1;
}

#endif
</code></pre>

<p>Main.cpp</p>

<pre><code>#include "Point.h"
#include &lt;iostream&gt;
#include &lt;ostream&gt;
#include &lt;fstream&gt;
#include &lt;sstream&gt;
#include &lt;set&gt;
#include &lt;math.h&gt;
#include &lt;set&gt;
#include &lt;string.h&gt;
#include &lt;string&gt;
#include &lt;stdio.h&gt;
#include &lt;map&gt;
#include &lt;algorithm&gt;
#include &lt;map&gt;

using namespace std;

class Main
{
    public: 
        void mainMenu();
        void stringToUpper(string &amp;s);
};

void stringToUpper(string &amp;s)
{
    for(unsigned int l=0; l &lt; s.length(); l++)
    {
        s[l] = toupper(s[l]);    
    }
}

void Main::mainMenu()
{
    cout&lt;&lt;"1)   type filename and read data"&lt;&lt;endl;
    cout&lt;&lt;"2)   View data"&lt;&lt;endl;    
    cout&lt;&lt;"Q)   Enter 'Q' to quit"&lt;&lt;endl&lt;&lt;endl;
}

int main()
{
    Main main;
    char menuChoice;
    bool quit=false;
    int count = 0;

    set&lt;Point&gt; p;

    while ( !quit)
    {
        main.mainMenu();
        cout &lt;&lt; "Please enter your choice : ";
        cin&gt;&gt;menuChoice;
        menuChoice = toupper(menuChoice);

        switch(menuChoice)
        {
            case '1':
                {
                    string line, name;
                    char filename[50];
                    int x,y;

                    cout &lt;&lt; "Please enter filename : ";
                    cin &gt;&gt; filename;

                    ifstream myfile(filename);
                    if (myfile.is_open())
                    {
                        while ( myfile.good() )
                        {
                            getline(myfile, line);
                            {      
                                for (unsigned int i = 0; i &lt; line.size(); ++i) 
                                {
                                    if (line[i] == '[' || line[i] == ']' || line[i] == ',') 
                                    {
                                        line[i] = ' ';
                                    }
                                    istringstream in(line);
                                    in &gt;&gt; name &gt;&gt; x &gt;&gt; y;                                  
                                }
                                if(name == "Point")
                                {
                                p.insert(Point(x,y))    }                        
                            }                                
                            count++;
                        }    
                        myfile.close();
                        cout &lt;&lt; count;
                    }
                    else cout&lt;&lt; "Unable to open file";
                }
                break;                             
            case '2':
                {
                cout&lt;&lt;"view data"&lt;&lt;endl;
                }                   
            case 'Q':
                cout&lt;&lt;"You have chosen to quit!"&lt;&lt;endl;
                quit=true;
                exit(0);
            default:
                cout&lt;&lt;"Invalid entry"&lt;&lt;endl&lt;&lt;endl;
                break;
        }
    }
}
</code></pre>
