vtk-m/vtkmstd
Kenneth Moreland 4a7aae86f9 Allow Variant to be trivial
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.
2020-09-22 16:22:37 -06:00
..
aligned_union.h Add porting layer for future std features 2020-03-16 17:12:16 -06:00
CMakeLists.txt Allow Variant to be trivial 2020-09-22 16:22:37 -06:00
integer_sequence.h clang-format: reformat the repository with clang-format-9 2020-08-24 14:01:08 -04:00
is_trivial.h Allow Variant to be trivial 2020-09-22 16:22:37 -06:00
void_t.h Add porting layer for future std features 2020-03-16 17:12:16 -06:00