Compiler Status Review Stream starting imminently. http://twitch.tv/naysayer88?q=4322 … We'll give people about 7 minutes to show up before starting!
-
Show this thread
-
Replying to @Jonathan_Blow
Like Jon I think that 75% of the cruft and perf mess in C++ is to do with constructors and destructors. I think they get badly abused - RAII shouldn't be quite so literal. I mainly use them to set up error values to spot when I didn't call Init()/Fini() correctly.
1 reply 0 retweets 11 likes -
Replying to @tom_forsyth @Jonathan_Blow
Isn’t 75% of all power of C++ in destructors, too?
1 reply 0 retweets 0 likes -
Replying to @ArvidGerstmann @Jonathan_Blow
I mean technically yes because it's the 75% of C++ that is awful and needs to be nuked. Look - all that stuff, other languages do much much better, and C++ can never be that great at it because legacy, but the language designers spend so much time trying to make it work.
2 replies 0 retweets 3 likes -
If you want constructors to be this awesome powerful one-line-of-code-does-your-whole-ago then you need to go much higher level - get a GC, build a lot more type inference into the language, etc. Don't start with a language originally designed for low-level OS and perf!
2 replies 0 retweets 0 likes -
What exactly do you mean by this "powerful thing"? C++ ctors/dtors just make it possible to afford not having a gc, they're not that fancy.
1 reply 0 retweets 1 like -
Half the features of every new C++ version is to try to deal with the performance implications of everything-is-a-bloody-constructor.
2 replies 0 retweets 1 like -
I'm not sure which ones you're referring to... If you mean move constructors / rvalue refs, they aren't for making things faster.
2 replies 0 retweets 1 like -
Replying to @nice_byte @tom_forsyth and
They do though, when they're used instead of copy construction/assignment?
1 reply 0 retweets 0 likes -
Replying to @Doomed_Daniel @tom_forsyth and
No, that's not what they're for. One uses that feature to more precisely express ownership semantics in their program. The fact that move might be faster than copy is completely irrelevant - the move ctor could theoretically perform _any_ computation, including one that is slower
2 replies 0 retweets 1 like
This is "Modern C++" revisionist history. Moves are absolutely about perf.
-
-
Replying to @Jonathan_Blow @Doomed_Daniel and
See unique_ptr or other similar move-only types.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.