Skip to content

Remove misleading comment in FieldVector initializer list

Santiago Ospina De Los Ríos requested to merge cleanup/remove-old-comment into master

Today I was hit by this assert saying that I initialized my FieldVector with the wrong number of elements. I am glad it hit this assert because my code was obviously wrong:

FieldVector<double, 3> fvec{1.}; // ends up with {1., 0., 0.}
FieldVector<double, 3> fvec(1.); // ends up with {1., 1., 1.} -> what I meant

To my surprise, the assert is followed by this comment: // Actually, this is not needed any more!

So this MR is to remove this (IMO) misleading comment. The assert is needed in my opinion as initialization with initializer list of a field vector with a number of elements different than its dimension is most likely not what the programmer wanted to do.

Edited by Santiago Ospina De Los Ríos

Merge request reports

Loading