Yup, you're correct about the *static* part, I wasn't thinking thread safe! I was actually thinking more of a static local variable, but yes, a member is definitely better here. At the same time, I haven't looked at the io libs in awhile, wouldn't that still have to be appropriately locked regardless? Using a static variable like this is bad practice, but in the context, wouldn't it hold the same thread safety as the member var? Off topic, but genuinely curious. 

The vector::clear() would still be O(C*n), but again not necessary for debate! Does add unnecessary running time to the operations, though.