Hi!
I'm trying to make a function that checks if an object of type Block* with the m_ID same as the one I'm giving it exists inside a vector. Can I just overload an operator and that is all that it needs? the ==?
Some more information:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//The vector in the class Map:
std::vector<Block*> m_ActiveSeeds;
//current function prototype
bool Map::addSeed(Block* test){
if(test (exists in m_ActiveSeeds)){
returnfalse
}
else{
m_ActiveSeeds.push_back(test);
}
//the Block class info
class Block{
private:
pair<int,int> m_ID;
public:
pair<int,int> getID(){return m_ID;}