Earlier I asked this question which was on how to make my own set operations class e.g. intersection, union etc.
The answer I chose as my solution recommended the algorithm library which have these operations already implemented. I want to get these operations working on my data types like this:
struct my_data_type {
int label;
vector<string> x;
vector<string> y;
string str;
};
so it was suggested that I include these things in my struct (or class):
- A public copy constructor.
- A public assignment operator.
- A public destructor.
I'm relatively new to C/C++ so please could someone provide me with these three things for the example struct that I defined here? Then also how to use one of the operations on my class (let's say set_intersection(...)
?
Thank you.