Commit 799dbacd authored by dpugmire's avatar dpugmire
Browse files

Merge branch 'master' of into add_SOA_to_default_types

parents 21a31370 58bd890c
......@@ -55,6 +55,19 @@ struct VariantDestroyFunctor
template <typename T>
struct VariantCheckType
// We are currently not allowing reference types (e.g. FooType&) or pointer types (e.g. FooType*)
// in Variant objects. References and pointers can fail badly when things are passed around
// devices. If you get a compiler error here, consider removing the reference or using something
// like std::decay to remove qualifiers on the type. (We may decide to do that automatically in
// the future.)
"References are not allowed in VTK-m Variant.");
VTKM_STATIC_ASSERT_MSG(!std::is_pointer<T>::value, "Pointers are not allowed in VTK-m Variant.");
template <typename... Ts>
struct AllTriviallyCopyable;
......@@ -306,6 +319,9 @@ class Variant : detail::VariantConstructorImpl<Variant<Ts...>>
using Superclass = detail::VariantConstructorImpl<Variant<Ts...>>;
// Type not used, but has the compiler check all the types for validity.
using CheckTypes = vtkm::List<detail::VariantCheckType<Ts>...>;
/// Returns the index of the type of object this variant is storing. If no object is currently
/// stored (i.e. the `Variant` is invalid), an invalid is returned.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment