@Chano wrote:
@kuhar wrote:
It’s not a big deal due to move semantics, perfect forwarding, copy elision and small string optimization.
Really? For example, in this common (I think) code there’s 1000 unnecessary memory allocations:
for(int index = 0; index < 1000; index++) { Sprite* sprite = Sprite::createWithSpriteFrameName("whatever"); }
I have a suggestion for you: write such benchmark and publish the result here. Please remember to test it on both x86 and ARM. I’m really curious about the real difference between these two solutions.
Otherwise no one is going to take your concerns seriously.
edit:
Anyway, the example class already has move semantics, because move constructor and assignment operator is added automatically
Which is not supported by visual studio (vc 12).