C++ - calling derived function from abstract base pointer
问题 I have been trying to create a TCP Server model based on inheritance, with varying success. These servers are managed by a singleton whose task it is to shut these servers down and other simple maintenance functions: class TCPServer { public: TCPServer(); ~TCPServer(); void Bind(TCPDaemon *daemon) { if(!daemon->IsRunning()) { throw TCPBindException("Daemon is inactive"); } // if the port is not taken, bind this daemon to it if(this->servers.count(daemon->port())==0) { this->servers[daemon-