I have a following trouble:
struct ServerPP {
std::string name;
int id;
int expires;
};
std::map> Rem
You have to define operator <
for your ServerPP
data structure if you want to be able to use it in std::set
. For instance:
bool operator < (ServerPP const& lhs, ServerPP const& rhs)
{
return (lhs.id < rhs.id);
}
Alternatively, you can define your own comparator and provide its type as the second template argument to std::set
:
struct serv_comp
{
bool operator () (ServerPP const& lhs, ServerPP const& rhs)
{
return (lhs.id < rhs.id);
}
};
std::map<std::string, std::set<ServerPP, serv_comp>> RemindTable;
Here is a live example showing the code compiling.