I have template class
template<class T1 ,class T2, class T3>
class server_fd
{
T1 servport;
T2 server_ip;
T3 servobj;
int local_port;
public:
server_fd(const T1& servport, const T2& server_ip,const T3 servobj) {
this->servport=servport;
this->server_ip=server_ip;
this->servobj=servobj;
cout <<"check \n"<<this->server_ip;
}
};
Now i want to store the object of this class in map ,so i am declaring map like this..
map<int,server_fd* > MapPairList;
After this when i complile my code it give this error error: template argument 2 is invalid error: template argument 4 is invalid
However if i dont use template class i am able to define map successfully.
Is there any other way to define map for storing template class object ? Please let me know.