In any case, I believe that the heap distributing each member like this will be slower. In addition to the initial heap allocation performed only by construction, holding pointers to many small non-contiguous data items on the heap do not play well with CPU caching strategies.
Some classes are very well ported because they have a large chunk of memory with a bunch of them (e.g. w990>). In your case, moving each pointer will be about as expensive as moving your smaller data types. The only way I can see that this is faster is to wrap your smaller data members in a class / structure allocated by the heap (maybe there is a unique_invest for it) and moving all of them by moving one pointer.
However, this is most likely a case of premature optimization. You might want to make the code work the way it is and determine that implementing more complex move semantics for your class can really help your code performance.
source share