Could you just push_back(0); pop_back() on anything that enters into m_PrecXYZFileName? Like that you don't need to repeat  this for all elements.