derived class deletion
category: code [glöplog]
Quote:
Valgrind? Is that what Linux programmers do instead of having a HTTP server [...]
C++? Is that what sceners use instead of a properly designed language?
Oh, fuck off.
Gargaj, really, amigados is *that* bad? glad I'm not coding for it :)
Agree with blabla.. give me either C or some real high-level language. Not an abomination like C++
Agree with blabla.. give me either C or some real high-level language. Not an abomination like C++
Kravitz/Inf once told me that C++'s attempt at creating object orientation on top of C resembled glueing legs to an earthworm in order to create a millipede. It might be a quote from somewhere else, but I think it's a good point.
C++ sucks, but it's sadly often the only real option. I prefer vanilla C when I can get away with it, though.
C++ sucks, but it's sadly often the only real option. I prefer vanilla C when I can get away with it, though.
C++ isn't bad, it's just not perfect. But the fact that it's "often the only real option" says a lot, given the number of alternatives. At the end of the day, C++ produces leaner, meaner, and more maintainable code than other languages, precisely because of all those "poor" design choices that people criticise it for. And many of its supposed shortcomings are in fact not, like the lack of GC (GC is great in theory, but in reality it makes resource management a lot harder).
I'm running Linux, I'm not sure if I can let the OS act as the deallocator.
I'll have to check if there's something like ExitProcess.
Thanks all for the input.
I'll have to check if there's something like ExitProcess.
Thanks all for the input.
Quote:
I'm running Linux, I'm not sure if I can let the OS act as the deallocator.
Yes you can. I don't think there's any OS left outside of extremely resource-constrained embedded systems that doesn't do this.
Quote:
I'll have to check if there's something like ExitProcess.
It's called exit(). Like, the one from stdlib.h. Duh.
#define exit cleanUpMyShitBitchAndLeave
#define exit() return
Code:
template<void (*F)()> struct EXIT{static void EXIT(){F();}};
int main() {
EXIT<exit>::EXIT();
}
what, no try-catch?