News for hackers. Stuff that matters.
Re:The cost of dynamic vs. static dispatch in C++ by nly on Thursday December 05, 2013 @10:46AM (#6854948)
When you think you can use CRTP instead of virtual dispatch in your program, you didn't need virtual dispatch to begin with... you needed a generic algorithm to operate over your object classes. That's exactly what run_crtp() is, the CRTPInterface class is completely redundant except that it provides some degree of compile-time concept checking (which we'll hopefully get in C++17)

Virtual dispatch is useful for type erasure, when using abstract types from plugins, DLLs or generally "somebody elses code". IMHO, the valid use cases within a standalone program are actually fairly small.

Re:The cost of dynamic vs. static dispatch in C++ by jamesaguilar on Thursday December 05, 2013 @11:44AM (#6855325)
Unit testing is my #1 use for virtual functions. "somebody else's code" a.k.a. standard ML modules is a distant second.