mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Specialize swap for ArrayPortalValueReference types.
This commit is contained in:
parent
761f8986fa
commit
d602784348
@ -101,6 +101,26 @@ void swap(vtkm::internal::ArrayPortalValueReference<T> a,
|
||||
{
|
||||
a.Swap(b);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void swap(vtkm::internal::ArrayPortalValueReference<T> a,
|
||||
typename vtkm::internal::ArrayPortalValueReference<T>::ValueType& b)
|
||||
{
|
||||
using ValueType = typename vtkm::internal::ArrayPortalValueReference<T>::ValueType;
|
||||
const ValueType tmp = a;
|
||||
a = b;
|
||||
b = tmp;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void swap(typename vtkm::internal::ArrayPortalValueReference<T>::ValueType& a,
|
||||
vtkm::internal::ArrayPortalValueReference<T> b)
|
||||
{
|
||||
using ValueType = typename vtkm::internal::ArrayPortalValueReference<T>::ValueType;
|
||||
const ValueType tmp = b;
|
||||
b = a;
|
||||
a = tmp;
|
||||
}
|
||||
}
|
||||
} // namespace vtkm::internal
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user