Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

C++ and copying

Name: Anonymous 2013-06-13 5:34

Why the fuck does everything in C++ insist on endlessly copying shit here and there, spawning 4 (FOUR!!!) copies of some fucking object during certain calls to methods of stdlib containers (vector, tuple etc).

I can't create a fucking thread without it copying my ``functor'' object (with operator()) at least twice for some fucking reason.

So yeah, if you want fast C++ programs, you fucking write them in C, with manual handling of pointers and shit.  Fuck C++.

Name: Anonymous 2013-06-13 5:59

>>2
But it calls both the constructor (which in C++ must not be anything non-trivial, that is, the constructor MUST be trivial) and the destructor.  If you have some cleanup logic for reference members in your destructor, good fucking luck finding which of the copies releases this or that resource.
So it's C all over again: you have the constructor, the init function, the finalize function, and the destructor.
Thanks for mentioning D, I will give it a try for some of my personal projects when I have more time, meanwhile I'm going back to destroying my brain with C++ on my day job

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List