vtk-m2/docs/changelog/vec-vec-constructors.md
luz.paz 940c891886 Misc. typos
Found via `codespell` and `grep`
more typos

includes source typo change and a typo that needs further review
follow-up typos


Follow-up typos


Revert a commit
2018-06-14 16:49:11 -04:00

674 B

VTK-m Vec< Vec > can't be constructed from Vec

When you have a Vec<Vec<float,3>> it was possible to incorrectly initialize it with the contents of a Vec<double,3>. An example of this is:

using Vec3d = vtkm::Vec<double, 3>;
using Vec3f = vtkm::Vec<float, 3>;
using Vec3x3f = vtkm::Vec<Vec3f, 3>;

Vec3d x(0.0, 1.0, 2.0);
Vec3x3f b(x); // becomes [[0,0,0],[1,1,1],[2,2,2]]
Vec3x3f c(x, x, x); // becomes [[0,1,2],[0,1,2],[0,1,2]]
Vec3x3f d(Vec3f(0.0f,1.0f,2.0f)) //becomes [[0,0,0],[1,1,1],[2,2,2]]

So the solution we have chosen is to disallow the construction of objects such as b. This still allows the free implicit cast to go from double to float.