Commit 18f3b0dc authored by Robert Maynard's avatar Robert Maynard
Browse files

Document all the free functions for VariantArrayHandle

parent 5180d6a7
......@@ -290,20 +290,24 @@ using VariantArrayHandle = vtkm::cont::VariantArrayHandleBase<VTKM_DEFAULT_TYPE_
//=============================================================================
// Free function casting helpers
/// Returns true if \c variant matches the type of ArrayHandleType.
///
template <typename ArrayHandleType, typename Ts>
VTKM_CONT inline bool IsType(const vtkm::cont::VariantArrayHandleBase<Ts>& variant)
{
return variant.template IsType<ArrayHandleType>();
}
/// Returns \c variant cast to the given \c ArrayHandle type. Throws \c
/// ErrorBadType if the cast does not work. Use \c IsType
/// to check if the cast can happen.
///
template <typename ArrayHandleType, typename Ts>
VTKM_CONT inline ArrayHandleType Cast(const vtkm::cont::VariantArrayHandleBase<Ts>& variant)
{
return variant.template Cast<ArrayHandleType>();
}
namespace detail
{
......
Markdown is supported
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