kokkos-utils 0.0.1
 
Loading...
Searching...
No Matches
type_traits.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_UTILS_IMPL_TYPE_TRAITS_HPP
2#define KOKKOS_UTILS_IMPL_TYPE_TRAITS_HPP
3
4#include <type_traits>
5
14
15namespace Kokkos::utils::impl
16{
17
25template <class T, template <typename...> class U>
26inline constexpr bool is_instance_of_v = std::false_type{};
27
28template <template <typename...> class U, typename... Vs>
29inline constexpr bool is_instance_of_v<U<Vs...>, U> = std::true_type{};
30
31template <typename T, template <typename...> class U>
34
36template <typename T, typename... Ts>
37concept IsTypeOneOf = std::disjunction_v<std::is_same<T, Ts>...>;
38
39} // namespace Kokkos::utils::impl
40
41#endif // KOKKOS_UTILS_IMPL_TYPE_TRAITS_HPP
Check if T is the same as one of the types Ts.
constexpr bool is_instance_of_v