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-2025 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_VALUES_INTEGRAL_HPP
17 #define OPENKALMAN_VALUES_INTEGRAL_HPP
18 
19 #include "basics/basics.hpp"
20 #include "value.hpp"
22 
23 namespace OpenKalman::values
24 {
25 #ifndef __cpp_concepts
26  namespace detail
27  {
28  template<typename T, typename = void>
29  struct reduces_to_integral : std::false_type {};
30 
31 
32  template<typename T>
33  struct reduces_to_integral<T, std::enable_if_t<std::is_integral_v<value_type_of_t<T>>>>
34  : std::true_type {};
35  }
36 #endif
37 
38 
42 #ifdef __cpp_concepts
43  template<typename T>
44  concept integral = value<T> and std::integral<value_type_of_t<T>>;
45 #else
46  template<typename T>
47  constexpr bool integral = value<T> and detail::reduces_to_integral<T>::value;
48 #endif
49 
50 }
51 
52 #endif
Definition for value:value_type_of and value:value_type_of_t.
Definition for values::abs.
Definition: fixed-constants.hpp:23
constexpr bool integral
T is an integral value.
Definition: integral.hpp:47
Basic definitions for OpenKalman as a whole.
Definition for values::value.