Viskores  1.0
Meta.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_internal_Meta_h
19 #define viskores_internal_Meta_h
20 
21 // This header file contains templates that are helpful with template metaprogramming.
22 
23 // Perhaps one day these structures can be exposed in the public interface, but the
24 // interface is a little wonky.
25 
26 #include <type_traits>
27 
28 namespace viskores
29 {
30 namespace internal
31 {
32 namespace meta
33 {
34 
36 template <typename T>
37 struct Type
38 {
39  using type = T;
40 };
41 
42 namespace detail
43 {
44 
45 template <typename T1, typename T2>
46 struct AndImpl : std::integral_constant<bool, T1::value && T2::value>
47 {
48 };
49 
50 template <typename T1, typename T2>
51 struct OrImpl : std::integral_constant<bool, T1::value || T2::value>
52 {
53 };
54 
55 template <typename T>
56 struct NotImpl : std::integral_constant<bool, !T::value>
57 {
58 };
59 
60 } // namespace detail
61 
64 template <typename T1, typename T2>
65 using And = typename detail::AndImpl<T1, T2>::type;
66 
69 template <typename T1, typename T2>
70 using Or = typename detail::OrImpl<T1, T2>::type;
71 
74 template <typename T>
75 using Not = typename detail::NotImpl<T>::type;
76 
79 template <typename T>
80 using Identity = T;
81 
82 }
83 }
84 } // namespace viskores::internal::meta
85 
86 #endif //viskores_internal_Meta_h
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27