|
|
|
|
|
by UncleMeat
2118 days ago
|
|
> BTW.. in his example - just use move semantics, put the pointer as the 5th argument, and you'll probably have the same runtime cost He talks about this. C++ doesn't have destructive moves like rust does, which is the root cause of why you cannot make the unique_ptr cost zero. It'd take an ABI change to fix this. This is precisely why the scenario is interesting. A lot of people (including you) thought that "just use move semantics" would solve it. |
|
There are indeed cases where this sort of difference in performance matters; But those are a vanishingly small group of people; and as far as those people are concerned - they typically look at assembly anyway.