//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #ifndef vtk_m_internal_ArrayPortalHelpers_h #define vtk_m_internal_ArrayPortalHelpers_h #include #include namespace vtkm { namespace internal { namespace detail { template struct PortalSupportsGetsImpl { template ().Get(vtkm::Id{}))> static std::true_type has(int); template static std::false_type has(...); using type = decltype(has(0)); }; template struct PortalSupportsGets3DImpl { template ().Get(vtkm::Id3{}))> static std::true_type has(int); template static std::false_type has(...); using type = decltype(has(0)); }; template struct PortalSupportsSetsImpl { template ().Set(vtkm::Id{}, std::declval()))> static std::true_type has(int); template static std::false_type has(...); using type = decltype(has(0)); }; template struct PortalSupportsSets3DImpl { template ().Set(vtkm::Id3{}, std::declval()))> static std::true_type has(int); template static std::false_type has(...); using type = decltype(has(0)); }; template struct PortalSupportsIteratorsImpl { template ().GetIteratorBegin())> static std::true_type has(int); template static std::false_type has(...); using type = decltype(has(0)); }; } // namespace detail template using PortalSupportsGets = typename detail::PortalSupportsGetsImpl::type>::type; template using PortalSupportsGets3D = typename detail::PortalSupportsGets3DImpl::type>::type; template using PortalSupportsSets = typename detail::PortalSupportsSetsImpl::type>::type; template using PortalSupportsSets3D = typename detail::PortalSupportsSets3DImpl::type>::type; template using PortalSupportsIterators = typename detail::PortalSupportsIteratorsImpl::type>::type; } } // namespace vtkm::internal #endif //vtk_m_internal_ArrayPortalHelpers_h