pRC
multi-purpose Tensor Train library for C++
Loading...
Searching...
No Matches
is_even.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-2-Clause
2
3#ifndef pRC_CORE_BASIC_FUNCTIONS_IS_EVEN_H
4#define pRC_CORE_BASIC_FUNCTIONS_IS_EVEN_H
5
7
8namespace pRC
9{
10 template<class T, If<IsIntegral<T>> = 0>
11 static inline constexpr auto isEven(T const a)
12 {
13 return a % T(2) == 0;
14 }
15
16 template<class T, T V, If<IsIntegral<T>> = 0>
17 static inline constexpr auto isEven(Constant<T, V> const)
18 {
19 return V % T(2) == 0;
20 }
21}
22#endif // pRC_CORE_BASIC_FUNCTIONS_IS_EVEN_H
Definition cholesky.hpp:18
static constexpr auto isEven(T const a)
Definition is_even.hpp:11
std::integral_constant< T, V > Constant
Definition type_traits.hpp:34
static constexpr Conditional< IsSatisfied< C >, RemoveConstReference< X >, X > copy(X &&a)
Definition copy.hpp:13