VTK  9.2.6
vtkTypeList.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTypeList.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
17// The Loki Library
18// Copyright (c) 2001 by Andrei Alexandrescu
19// This code accompanies the book:
20// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
21// Patterns Applied". Copyright (c) 2001. Addison-Wesley.
22// Permission to use, copy, modify, distribute and sell this software for any
23// purpose is hereby granted without fee, provided that the above copyright
24// notice appear in all copies and that both that copyright notice and this
25// permission notice appear in supporting documentation.
26// The author or Addison-Wesley Longman make no representations about the
27// suitability of this software for any purpose. It is provided "as is"
28// without express or implied warranty.
30
50#ifndef vtkTypeList_h
51#define vtkTypeList_h
52
53#include "vtkTypeListMacros.h"
54
55namespace vtkTypeList
56{
57
58//------------------------------------------------------------------------------
63{
64};
65
66//------------------------------------------------------------------------------
68
71template <typename T, typename U>
73{
74 typedef T Head;
75 typedef U Tail;
76};
78
79//------------------------------------------------------------------------------
83template <bool Exp, typename T, typename F>
84struct Select;
85
86//------------------------------------------------------------------------------
91template <typename From, typename To>
93
94//------------------------------------------------------------------------------
99template <typename TList, typename T>
100struct IndexOf;
101
102//------------------------------------------------------------------------------
107template <typename TList, typename T>
108struct Erase;
109
110//------------------------------------------------------------------------------
114template <typename TList, typename T>
115struct EraseAll;
116
117//------------------------------------------------------------------------------
122template <typename TList>
123struct Unique;
124
125//------------------------------------------------------------------------------
130template <typename TList, typename Bad, typename Good>
131struct Replace;
132
133//------------------------------------------------------------------------------
138template <typename TList, typename Bad, typename Good>
140
141//------------------------------------------------------------------------------
147template <typename TList, typename T>
149
150//------------------------------------------------------------------------------
156template <typename TList>
158
159//------------------------------------------------------------------------------
163template <typename TList, typename T>
164struct Append;
165
166} // end namespace vtkTypeList
167
168#include "vtkTypeList.txx"
169
170namespace vtkTypeList
171{
172
173template <typename... Ts>
174using Create = typename vtkTypeList::detail::CreateImpl<Ts...>::type;
175
176} // end namespace vtkTypeList
177
178#endif // vtkTypeList_h
179// VTK-HeaderTest-Exclude: vtkTypeList.h
typename vtkTypeList::detail::CreateImpl< Ts... >::type Create
Appends type T to TypeList TList and stores the result in Result.
Sets member Result to true if a conversion exists to convert type From to type To.
Definition vtkTypeList.h:92
Sort the TypeList from most-derived to least-derived type, storing the sorted TypeList in Result.
Erase all type T from TypeList TList, storing the new list in Result.
Erase the first element of type T from TypeList TList, storing the new list in Result.
Sets the enum value Result to the index of type T in the TypeList TList.
Given a type T and a TypeList TList, store the most derived type of T in TList as Result.
Used to terminate a TypeList.
Definition vtkTypeList.h:63
Replace all instances of Bad with Good in the TypeList TList, storing the new list in Result.
Replace the first instance of Bad with Good in the TypeList TList, storing the new list in Result.
Sets Result to T if Exp is true, or F if Exp is false.
Definition vtkTypeList.h:84
Generic implementation of TypeList.
Definition vtkTypeList.h:73
Remove all duplicate types from TypeList TList, storing the new list in Result.