четверг, 6 февраля 2014 г.

Move semantics - optimisation or syntax fix?

Recently I joined army of C++11 explorers (better late than never). Of course move semantics is one of the most interesting new features of the language but does it really useful? It increases complexity of source code in exchange for potential performance gain. For example this article shows a case when move semantics can be beneficial with the only catch that initial example was purposefully pessimized.
Those who care about performance will carefully use pointers, references, inline, etc ... and profile there code. With move semantics you get your code as fast as before but not that ugly – so the real gain that I see is syntax improvement under the sauce of optimal code generation.

Комментариев нет:

Отправить комментарий