I have a Class called Request like this,
class Request {};
I store objects of this type in a global vector called,
std::vector<Request> requests;
I initialize the object using,
auto &request = requests.emplace_back();
Now, I attempt to delete the object using the reference provided by emplace_back
like this,
requests.erase(std::remove(requests.begin(), requests.end(), request), requests.end());
It fails to compile and outputs following error,
sysroot/include/c++/v1\algorithm:2103:24: error: invalid operands to binary
expression ('Request' and 'const Request')
if (!(*__i == __value_))
~~~~ ^ ~~~~~~~~
What should I do here to make it compile?