Merge topic 'implicit-copy-ctor'

783bc15ff Do not rely on implict copy constructors when destructor defined

Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robert.maynard@kitware.com>
Merge-request: !1999
This commit is contained in:
Kenneth Moreland 2020-03-19 14:27:04 +00:00 committed by Kitware Robot
commit 7108f745ad
2 changed files with 26 additions and 3 deletions

@ -33,7 +33,6 @@ class VTKM_ALWAYS_EXPORT ArrayPortalRef : public vtkm::ArrayPortalRef<T>
public:
ArrayPortalRef() = default;
~ArrayPortalRef() = default;
ArrayPortalRef(std::shared_ptr<vtkm::ArrayPortalVirtual<T>> portal, vtkm::Id numValues) noexcept
: vtkm::ArrayPortalRef<T>(portal.get(), numValues),

@ -131,8 +131,32 @@ public:
}
}
VTKM_CONT
~FieldSelection() {}
// Normally the default compiler construction of each of these would be fine,
// but we don't want any of them compiled for devices (like CUDA), so we have
// to explicitly mark them as VTKM_CONT.
VTKM_CONT FieldSelection(const FieldSelection& src)
: Mode(src.Mode)
, Fields(src.Fields)
{
}
VTKM_CONT FieldSelection(FieldSelection&& rhs)
: Mode(rhs.Mode)
, Fields(std::move(rhs.Fields))
{
}
VTKM_CONT FieldSelection& operator=(const FieldSelection& src)
{
this->Mode = src.Mode;
this->Fields = src.Fields;
return *this;
}
VTKM_CONT FieldSelection& operator=(FieldSelection&& rhs)
{
this->Mode = rhs.Mode;
this->Fields = std::move(rhs.Fields);
return *this;
}
VTKM_CONT ~FieldSelection() {}
/// Returns true if the input field should be mapped to the output
/// dataset.