|
|
This thread is locked; no one can reply to it.
|
1
2
|
| std::thread and std::vector confusion? |
|
Thomas Fjellstrom
Member #476
June 2000
|
Peter Hull said: without the move it'll make a copy of inst to put into the vector, then inst itself will be destroyed some time later. If inst is big/complicated that could be expensive. Ok, makes sense. Mind you I typically use pointers for big complex objects. So it's kindof a moot point. taronĀ said: I personally don't use auto&& outside of template or generic lambdas. I tend to only use auto (forget about &&) when I want to avoid typing out a long string of line noise that they call container iterator types. In that case you don't even want to make it a reference. Now I have used T&& a fair bit in templates. or "Args&&... args" but thinking about it, that's probably best to trim down to "Args&... args" or drop the reference all together possibly. I'll have to test it. If the compiler isn't collapsing && down to & there, it'll case moves in places it won't be wanted in that code, sooo bad idea append: Basically I stole some code from here and modified it a bit. -- |
|
|
1
2
|