- Sure, this’ll work fine. The one thing you need to worry about is ensuring that the buffer is correctly aligned, if your class relies on a particular alignment; in this case you may want to use a vector of the datatype itself (like
float). - No, reserve is not necessary here; resize will automatically grow the capacity as necessary, in exactly the same way.
- Before C++03, technically not (but in practice yes). Since C++03, yes.
Incidentally, though, memcpy_s isn’t the idiomatic approach here. Use std::copy instead. Keep in mind that a pointer is an iterator.
Starting in C++17, std::byte is the idiomatic unit of opaquely typed storage such as you are using here. char will still work, of course, but allows unsafe usages (as char!) which byte does not.