OpenKalman
integral.hpp
Go to the documentation of this file.
1 /* This file is part of OpenKalman, a header-only C++ library for
2  * Kalman filters and other recursive filters.
3  *
4  * Copyright (c) 2024 Christopher Lee Ogden <ogden@gatech.edu>
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
9  */
10 
16 #ifndef OPENKALMAN_VALUE_INTEGRAL_HPP
17 #define OPENKALMAN_VALUE_INTEGRAL_HPP
18 
19 #include <type_traits>
20 #ifdef __cpp_concepts
21 #include <concepts>
22 #endif
23 #include "value.hpp"
25 
26 namespace OpenKalman::values
27 {
28 #ifndef __cpp_concepts
29  namespace detail
30  {
31  template<typename T, typename = void>
32  struct reduces_to_integral : std::false_type {};
33 
34 
35  template<typename T>
36  struct reduces_to_integral<T, std::enable_if_t<std::is_integral_v<values::number_type_of_t<T>>>>
37  : std::true_type {};
38  }
39 #endif
40 
41 
45 #ifdef __cpp_concepts
46  template<typename T>
47  concept integral = values::value<T> and std::integral<values::number_type_of_t<T>>;
48 #else
49  template<typename T>
50  constexpr bool integral = values::value<T> and detail::reduces_to_integral<T>::value;
51 #endif
52 
53 } // namespace OpenKalman::values
54 
55 #endif //OPENKALMAN_VALUE_INTEGRAL_HPP
Definition: tuple_reverse.hpp:103
Definition for value:number_type_of_t.
Definition for values::abs.
Definition: constant_coefficient.hpp:25
constexpr bool integral
T is an index value.
Definition: integral.hpp:50
Definition for ::value.