VTK-m  2.0
Meta.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_internal_Meta_h
11 #define vtk_m_internal_Meta_h
12 
13 // This header file contains templates that are helpful with template metaprogramming.
14 
15 // Perhaps one day these structures can be exposed in the public interface, but the
16 // interface is a little wonky.
17 
18 #include <type_traits>
19 
20 namespace vtkm
21 {
22 namespace internal
23 {
24 namespace meta
25 {
26 
28 template <typename T>
29 struct Type
30 {
31  using type = T;
32 };
33 
34 namespace detail
35 {
36 
37 template <typename T1, typename T2>
38 struct AndImpl : std::integral_constant<bool, T1::value && T2::value>
39 {
40 };
41 
42 template <typename T1, typename T2>
43 struct OrImpl : std::integral_constant<bool, T1::value || T2::value>
44 {
45 };
46 
47 template <typename T>
48 struct NotImpl : std::integral_constant<bool, !T::value>
49 {
50 };
51 
52 } // namespace detail
53 
56 template <typename T1, typename T2>
57 using And = typename detail::AndImpl<T1, T2>::type;
58 
61 template <typename T1, typename T2>
62 using Or = typename detail::OrImpl<T1, T2>::type;
63 
66 template <typename T>
67 using Not = typename detail::NotImpl<T>::type;
68 
71 template <typename T>
72 using Identity = T;
73 
74 }
75 }
76 } // namespace vtkm::internal::meta
77 
78 #endif //vtk_m_internal_Meta_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19