3 ms·
I agree about constexpr, templates and exceptions. But C function pointers are not really emulating virtual functions. They're better and more powerful than vi
by Peaker 9y ago
I agree about constexpr, templates and exceptions.
But C function pointers are not really emulating virtual functions. They're better and more powerful than virtual functions.
- lomnakkus 9y ago> But C function pointers are not really emulating virtual functions. They're better and more powerful than virtual functions. "Better" is a value judgment, so I'm not sure about that, but... AFAICT they're more like prototypal inheritance than the inheritance model of C++.
- Peaker 9y agoThey're not really "inheritance". They can do what inheritance can do, and much much more.
- candiodari 9y agoIf that's your argument, then I'd say that C function pointers are absolute shit compared to LISP continuations. How would do I do this in C ? int some_function() { // some processing fp = package_the_rest_of_this_function_into_a_function_pointer() do_some_background_processing_and_callback(fp); // all the background processing is done } In LISP, this is easy, in fact, in most LISPs, it's builtin.
- Peaker 9y agoOf course that's true. But Lisp is shitty at controlling memory use, indirections, and manual MM.
- lomnakkus 8y agoWhich is why I said "more like". Can you give examples of this "much much more" you're referring to?