/* bar.h */ class bar{ /* standard stuff omitted */ std::vector foo; }; /* bar.cpp */ bar::bar(){ // foo = new std::vector();
Because bar contains a std::vector, not a std::vector *.
bar
std::vector
std::vector *
It's really no different to something like this:
class bar { int foo; // No need to create a "new int" };