VTK  9.1.20211028
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 
84 template <typename IterablePtr, typename... Options>
85 auto Range(IterablePtr iterable, Options&&... opts) ->
87 {
88  using Iterable = typename detail::StripPointers<IterablePtr>::type;
89  using RangeType = typename detail::IterableTraits<Iterable>::RangeType;
90  return RangeType{ iterable, std::forward<Options>(opts)... };
91 }
92 
93 } // end namespace vtk
94 
95 #endif // vtkRange_h
96 
97 // 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:85
typename std::decay< RangeTypeInternal >::type RangeType
This file contains a variety of metaprogramming constructs for working with vtk types.