VTK  9.4.20241222
vtkTypeList.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright (c) 2001 by Andrei Alexandrescu
3// SPDX-FileCopyrightText: Copyright (c) 2001. Addison-Wesley.
4// SPDX-License-Identifier: BSD-3-Clause AND MIT
5
7// The Loki Library
8// This code accompanies the book:
9// Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design
10// Patterns Applied".
12
35#ifndef vtkTypeList_h
36#define vtkTypeList_h
37
38#include "vtkABINamespace.h"
39#include "vtkTypeListMacros.h"
40
41namespace vtkTypeList
42{
43VTK_ABI_NAMESPACE_BEGIN
44
45//------------------------------------------------------------------------------
50{
51};
52
53//------------------------------------------------------------------------------
55
58template <typename T, typename U>
60{
61 typedef T Head;
62 typedef U Tail;
63};
65
66//------------------------------------------------------------------------------
70template <bool Exp, typename T, typename F>
71struct Select;
72
73//------------------------------------------------------------------------------
78template <typename From, typename To>
80
81//------------------------------------------------------------------------------
86template <typename TList, typename T>
87struct IndexOf;
88
89//------------------------------------------------------------------------------
94template <typename TList, typename T>
95struct Erase;
96
97//------------------------------------------------------------------------------
101template <typename TList, typename T>
102struct EraseAll;
103
104//------------------------------------------------------------------------------
109template <typename TList>
110struct Unique;
111
112//------------------------------------------------------------------------------
117template <typename TList, typename Bad, typename Good>
118struct Replace;
119
120//------------------------------------------------------------------------------
125template <typename TList, typename Bad, typename Good>
127
128//------------------------------------------------------------------------------
134template <typename TList, typename T>
136
137//------------------------------------------------------------------------------
143template <typename TList>
145
146//------------------------------------------------------------------------------
150template <typename TList, typename T>
151struct Append;
152
153VTK_ABI_NAMESPACE_END
154} // end namespace vtkTypeList
155
156#include "vtkTypeList.txx"
157
158namespace vtkTypeList
159{
160VTK_ABI_NAMESPACE_BEGIN
161
162template <typename... Ts>
163using Create = typename vtkTypeList::detail::CreateImpl<Ts...>::type;
164
165VTK_ABI_NAMESPACE_END
166} // end namespace vtkTypeList
167
168#endif // vtkTypeList_h
169// 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:79
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.
Definition vtkTypeList.h:95
Sets the enum value Result to the index of type T in the TypeList TList.
Definition vtkTypeList.h:87
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:50
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:71
Generic implementation of TypeList.
Definition vtkTypeList.h:60
Remove all duplicate types from TypeList TList, storing the new list in Result.