3 ms·
?? They appear completely different in C++, i.e. virtual functions vs. templates https://eli.thegreenplace.net/2013/12/05/the-cost-of-dynamic-virtual-calls-vs
by chubot 5y ago
?? They appear completely different in C++, i.e. virtual functions vs. templates
https://eli.thegreenplace.net/2013/12/05/the-cost-of-dynamic-virtual-calls-vs-static-crtp-dispatch-in-c https://eli.thegreenplace.net/2013/12/05/the-cost-of-dynamic...
I also wish they were more similar in both C++ and Rust. I find that most programs get more dynamic as they get bigger, get more usage, and get more extensible ... but the tendency is to want them to be as efficient as possible at the beginning.
- loeg 5y ago> They appear completely different in C++, i.e. virtual functions vs. templates Virtual vs non-virtual functions.
- chubot 5y agoOK there is some static dispatch in regular functions with respect to argument overloading, e.g. f(int) and f(char), or obj.f(int) and obj.f(char). But I think what is more commonly thought of as "static dispatch" is various template programming patterns, as in the blog post, which are more flexible, and has equivalents in Rust AFAIK. Overall it does feel like there are too many similar mechanisms that look extremely different!