February 1st, 2014, 11:32 PM
Re: Why is the CRTP used instead of virtual functions?
The C++ standard does not require any particular scheme for the implementation of virtual functions, hence it cannot require any particular optimisation pertaining to such implementations. It could require compilers to implement virtual calls as non-virtual calls wherever possible, but that may well be too loose a requirement since "wherever possible" depends on how good the compiler is at the analysis required to determine that such an optimisation can be correctly applied. So, for compilers that lack the implementation of such optimisations, this is not a bug, but rather the lack of a feature.
Originally Posted by TSLexi
Click Here to Expand Forum to Full Width