VTK  9.2.20230603
vtkRange.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkRange.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
16 #ifndef vtkRange_h
17 #define vtkRange_h
18 
19 #include "vtkMeta.h"
20 #include "vtkRangeIterableTraits.h"
21 
22 #include <iterator>
23 #include <type_traits>
24 #include <utility>
25 
26 namespace vtk
27 {
28 VTK_ABI_NAMESPACE_BEGIN
29 
85 template <typename IterablePtr, typename... Options>
86 auto Range(IterablePtr iterable, Options&&... opts) ->
88 {
89  using Iterable = typename detail::StripPointers<IterablePtr>::type;
90  using RangeType = typename detail::IterableTraits<Iterable>::RangeType;
91  return RangeType{ iterable, std::forward<Options>(opts)... };
92 }
93 
94 VTK_ABI_NAMESPACE_END
95 } // end namespace vtk
96 
97 #endif // vtkRange_h
98 
99 // 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:86
typename std::decay< RangeTypeInternal >::type RangeType
This file contains a variety of metaprogramming constructs for working with vtk types.