Commit caf6ac98 authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Improve documentation of UnknownArrayHandle::IsType

Under some circumstances, `IsType` can return false for a type that
exactly matches the type used to create the `UnknownArrayHandle`.
This is because types like `ArrayHandleCast` get converted to
the array they contain. Thus, `IsType` will return false when it
is expected to be true. In most cases, you should use
`CanConvert`. The `IsType` documentation now points you there.
parent 9fdb1255
Pipeline #254513 failed with stage
in 0 seconds
......@@ -499,7 +499,17 @@ public:
return this->IsBaseComponentTypeImpl(detail::UnknownAHComponentInfo::Make<BaseComponentType>());
}
/// Returns true if this array matches the ArrayHandleType template argument.
/// \brief Returns true if this array matches the ArrayHandleType template argument.
///
/// Note that `UnknownArrayHandle` has some special handling for `ArrayHandleCast` and
/// `ArrayHandleMultiplexer`. If you stored an array of one of these types into an
/// `UnknownArrayHandle`, the type of the underlying array will change and `IsType`
/// will fail. However, you can still get the array back out as that type using
/// `AsArrayHandle`.
///
/// Use the `CanConvert` method instead to determine if the `UnknownArrayHandle`
/// contains an array that "matches" the array of a given type. Under most
/// circumstances, you should prefer `CanConvert` over `IsType`.
///
template <typename ArrayHandleType>
VTKM_CONT bool IsType() const
......
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