Commit c255c0eb authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

add `vtkm::cont::ConditionalCastAndCall`

Adding a function to conditionally do CastAndCall.
parent 54c2d234
......@@ -116,6 +116,20 @@ void CastAndCall(const vtkm::cont::CellSetPermutation<PermutationType, CellSetTy
f(cellset, std::forward<Args>(args)...);
}
/// CastAndCall if the condition is true.
template <typename... Args>
void ConditionalCastAndCall(std::true_type, Args&&... args)
{
vtkm::cont::CastAndCall(std::forward<Args>(args)...);
}
/// No-op variant since the condition is false.
template <typename... Args>
void ConditionalCastAndCall(std::false_type, Args&&...)
{
}
namespace internal
{
......
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