So I learned something today: the 'using' keyword can also be used to
import function names from the enclosing namespace. This not only
solves the spammy virtual overload warnings that the new-fangled protocol
stuff introduced unwittingly, but also removes the need to redefine
RemotePeer::handle<>() as a forward to Peer::handle<>().
Also, someone please kick the C++ inventors for making method lookup
not follow the Koenig rules (contrary to most other lookups...).
protected:
SignalProxy *signalProxy() const;
- template<class T>
- void handle(const T &protoMessage);
+ using Peer::handle;
+ using Peer::dispatch;
// These protocol messages get handled internally and won't reach SignalProxy
void handle(const Protocol::HeartBeat &heartBeat);
int _lag;
};
-
-template<class T> inline
-void RemotePeer::handle(const T &protoMessage)
-{
- Peer::handle(protoMessage);
-}
-
-
#endif