c++ style / avoid copies / const correctness