i'm not sure if the code is equivalent to `&elements  = mesh->getElements()`.  If not, you are copying the entire vector here.