Also C++ is generally as fast as C. If anything, it's faster thanks to increased opportunities for inlining.
Whoever says C++ is slower than C is misinformed and/or overgeneralizing.
Professional C++ programmers know this already though.
Whoever says C++ is slower than C is misinformed and/or overgeneralizing.
Professional C++ programmers know this already though.
And std::function, from what I understand, is generally not as fast as a function pointer, a stored lambda, a function object, since it must do some run-time checks to see how to call what it is storing.
Whenever you need to make a function virtual in C++, you'd need to store a function pointer in an equivalent C design, somehow.
A generic collection is usually faster when implemented using templates instead of void*.