RAJA
RAJA provides a collection of platform portability abstractions for C++ HPC applications.
EnableIf.hpp
Go to the documentation of this file.
1 
13 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
14 // Copyright (c) Lawrence Livermore National Security, LLC and other
15 // RAJA Project Developers. See top-level LICENSE and COPYRIGHT
16 // files for dates and other details. No copyright assignment is required
17 // to contribute to RAJA.
18 //
19 // SPDX-License-Identifier: (BSD-3-Clause)
20 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
21 
22 #ifndef RAJA_util_EnableIf_HPP
23 #define RAJA_util_EnableIf_HPP
24 
25 #include "RAJA/config.hpp"
26 
27 #include <type_traits>
28 
29 #include "camp/list.hpp"
30 #include "camp/type_traits.hpp"
31 
32 #include "RAJA/util/concepts.hpp"
33 
34 namespace RAJA
35 {
36 namespace util
37 {
38 
39 
40 template<typename T, typename TypeList>
41 struct is_any_of;
42 
43 template<typename T, typename... Types>
44 struct is_any_of<T, ::camp::list<Types...>>
45  : ::RAJA::concepts::any_of<::camp::is_same<T, Types>...>
46 {};
47 
48 template<typename T, typename TypeList>
49 using enable_if_is_any_of = std::enable_if_t<is_any_of<T, TypeList>::value, T>;
50 
51 template<typename T, typename TypeList>
53  std::enable_if_t<::RAJA::concepts::negate<is_any_of<T, TypeList>>::value,
54  T>;
55 
56 
57 } // namespace util
58 } // namespace RAJA
59 
60 #endif // closing endif for header file include guard
Header file for RAJA concept definitions.
std::enable_if_t< is_any_of< T, TypeList >::value, T > enable_if_is_any_of
Definition: EnableIf.hpp:49
std::enable_if_t<::RAJA::concepts::negate< is_any_of< T, TypeList > >::value, T > enable_if_is_none_of
Definition: EnableIf.hpp:54
Definition: AlignedRangeIndexSetBuilders.cpp:35
Definition: EnableIf.hpp:41