, . std::vector , , ( ) , .
++ 11 union /, , , . , , . new, .
union, N 1, . union , ( ).
However, the likelihood is that the real answer to your question is "don't do this." And if you do, you will wrap the pointers in class, whose only task is to handle the above mess. Classes of this type (whose task is to control the pointer's lifetime and pointer properties) are called smart pointers.
source
share