/* bar.h */ class bar{ /* standard stuff omitted */ std::vector foo; }; /* bar.cpp */ bar::bar(){ // foo = new std::vector();
std::vector foo is different from std::vector *foo. The second case will require you to use new while the first wll not.
std::vector foo
std::vector *foo