Define not working correctly...given there is no definition for ensureCapacity, do you receive a compile time error? If not, please post an SSCCE which demonstrates the problem.