VTK  9.3.20240327
vtkRange.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
4 #ifndef vtkRange_h
5 #define vtkRange_h
6 
7 #include "vtkMeta.h"
9 
10 #include <iterator>
11 #include <type_traits>
12 #include <utility>
13 
14 namespace vtk
15 {
16 VTK_ABI_NAMESPACE_BEGIN
17 
73 template <typename IterablePtr, typename... Options>
74 auto Range(IterablePtr iterable, Options&&... opts) ->
76 {
77  using Iterable = typename detail::StripPointers<IterablePtr>::type;
78  using RangeType = typename detail::IterableTraits<Iterable>::RangeType;
79  return RangeType{ iterable, std::forward<Options>(opts)... };
80 }
81 
82 VTK_ABI_NAMESPACE_END
83 } // end namespace vtk
84 
85 #endif // vtkRange_h
86 
87 // VTK-HeaderTest-Exclude: vtkRange.h
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
auto Range(IterablePtr iterable, Options &&... opts) -> typename detail::IterableTraits< typename detail::StripPointers< IterablePtr >::type >::RangeType
Generate an iterable STL proxy object for a VTK container.
Definition: vtkRange.h:74
typename std::decay< RangeTypeInternal >::type RangeType
This file contains a variety of metaprogramming constructs for working with vtk types.