alpaka
Abstraction Library for Parallel Kernel Acceleration
NonZero.hpp
Go to the documentation of this file.
1 /* Copyright 2023 Andrea Bocci
2  * SPDX-License-Identifier: MPL-2.0
3  */
4 
5 #pragma once
6 
7 #include <type_traits>
8 
9 namespace alpaka::meta
10 {
11  namespace detail
12  {
13  template<typename T>
14  struct NonZeroImpl : std::false_type
15  {
16  };
17 
18  template<typename T, T TValue>
19  struct NonZeroImpl<std::integral_constant<T, TValue>> : std::bool_constant<TValue != static_cast<T>(0)>
20  {
21  };
22  } // namespace detail
23 
24  template<typename T>
25  using NonZero = typename detail::NonZeroImpl<T>;
26 
27 } // namespace alpaka::meta
typename detail::NonZeroImpl< T > NonZero
Definition: NonZero.hpp:25