
2 Apr
2008
2 Apr
'08
2:54 p.m.
Steven Watanabe wrote:
I was just thinking of moving the duplicated code into CRTPPacket
template
struct CRTPPacket : Packet { static const PacketID ID = Id; virtual PacketID getID() const { return(ID); } };
Does it even need to be CRTP? template<PacketID Id> struct IDPacket : Packet { static const PacketID ID = Id; virtual PacketID getID() const { return(ID); } }; Perhaps we're assuming other methods that would make use of Derived.