Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ecpcitest
vtk-m
Commits
799dbacd
Commit
799dbacd
authored
Mar 02, 2021
by
dpugmire
Browse files
Merge branch 'master' of
https://gitlab.kitware.com/vtk/vtk-m
into add_SOA_to_default_types
parents
21a31370
58bd890c
Changes
1
Hide whitespace changes
Inline
Side-by-side
vtkm/internal/VariantImpl.h
View file @
799dbacd
...
...
@@ -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.)
VTKM_STATIC_ASSERT_MSG
(
!
std
::
is_reference
<
T
>::
value
,
"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
>
...
>
;
public:
/// 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.
...
...
Atkins, Charles Vernon
@atkins3
mentioned in commit
548ea5ee
·
Mar 03, 2021
mentioned in commit
548ea5ee
mentioned in commit 548ea5ee9a42490dd7ec45260ca4053f96254bc3
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment