Hi all
While going thru Bye.h
inline Bye & Bye::castFrom (Packet & packet)
{ return dynamic_cast (packet); }
I think static_cast would be a better choice here…
The reason is that as the compiler can see the line
class Bye : public Packet
the static cast should be safe… ( We don’t need the heavy duty dynamic_cast here )
I mean here it may not matter much but if some cycles are saved the better…. and in other places it might make some difference.
Also dynamic_cast implies RTTI must be used and generated… here anway it is as Packet::copy is the virtual constructor stuff… but other places it could matter ;-)
I accept that safety offered by dynamic_cast is good and yes “Early optimization is the root of all evil” but still
here are my two cents … ;-)
