mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-08 03:18:58 +00:00
4a7aae86f9
Although `vtkm::internal::Variant` respected the trivially copyable attribute of the types it contains, it was never totally trivial (i.e. `std::is_trivial<Variant<...>>` was never true). The reason was that `Variant` was initializing its `Index` parameter to signify that it was not initialized. However, the fact that `Index` was initialized meant that it was not trivially constructed. Now, `Variant` type checks its types to see if they are all trivially constructible. If so, it makes itself trivially constructible. This means that `Index` may or may not be valid if `Variant` is constructed without an argument. This in turn means that the result of `Variant::IsValid` becomes undefined. That should be OK in practice. `Index` will "point" to an uninitialized object, but that object is trivially constructed anyway. However, that could cause problems if developers used `IsValid` to determine if something is selected. |
||
---|---|---|
.. | ||
aligned_union.h | ||
CMakeLists.txt | ||
integer_sequence.h | ||
is_trivial.h | ||
void_t.h |