As you've already known about smart pointers you can use them instead of new vector< bool > ().