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.

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]`

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.

Errors are:

> 
> In member function 'bool std::les<\_Tp>::operator()(const \_Tp&, const
>  \_Tp&) const [with \_Tp = Point]': STL\_TREE.h:980: instantiated from 'std::pair::iterator, bool> std::\_Rb\_tree<\_Key,.... STL\_SET.h:307: instantiated from 'std::pair, \_Compare, typename
>  \_Alloc::rebind<\_Key>::other>::const\_interator, bool> std::set..... main.cpp:141: instantiated from here stl\_function.h:227: error: no
>  match for 'operator<' in '\_*x <*\_y'
> 
> 
> 

Point.h

```
#ifndef POINT_H
#define POINT_H 

#include <iostream>
#include <ostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <string.h>
#include <string>
#include <stdio.h>

using namespace std;

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

    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

```

Main.cpp

```
#include "Point.h"
#include <iostream>
#include <ostream>
#include <fstream>
#include <sstream>
#include <set>
#include <math.h>
#include <set>
#include <string.h>
#include <string>
#include <stdio.h>
#include <map>
#include <algorithm>
#include <map>

using namespace std;

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

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

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

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

    set<Point> p;

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

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

                    cout << "Please enter filename : ";
                    cin >> filename;

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

```