Let's say I have a simple Server with a template which accepts a Client as it's template argument:
template<class T>
class Server<T>{
Server(int port);
}
and a Client is defined something like this:
class Client{
Client(Server<Client> *server, // <--
int socket);
};
But I also want say, have the class User
inherit from Client
(class User : public Client
), so I could do Server<User>
instead of Server<Client>
. class User
obviously needs to pass Server<Client>
as a parameter when constructing Client
. However, with the current implementation this seems impossible.
How should I approach this problem?