OpenKalman
scalar_type_of.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) 2019-2023 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_SCALAR_TYPE_OF_HPP
17 #define OPENKALMAN_SCALAR_TYPE_OF_HPP
18 
19 
20 namespace OpenKalman
21 {
27 #ifdef __cpp_concepts
28  template<typename T>
29 #else
30  template<typename T, typename = void>
31 #endif
32  struct scalar_type_of {};
33 
34 
38 #ifdef __cpp_concepts
39  template<interface::scalar_type_defined_for T>
40  struct scalar_type_of<T>
41 #else
42  template<typename T>
43  struct scalar_type_of<T, std::enable_if_t<interface::scalar_type_defined_for<T>>>
44 #endif
45  {
46  using type = typename interface::indexible_object_traits<std::decay_t<T>>::scalar_type;
47  };
48 
49 
53  template<typename T>
55 
56 
57 } // namespace OpenKalman
58 
59 #endif //OPENKALMAN_SCALAR_TYPE_OF_HPP
Definition: indexible_object_traits.hpp:36
typename scalar_type_of< T >::type scalar_type_of_t
helper template for scalar_type_of.
Definition: scalar_type_of.hpp:54
Definition: tuple_reverse.hpp:103
Type scalar type (e.g., std::float, std::double, std::complex<double>) of a tensor.
Definition: scalar_type_of.hpp:32
The root namespace for OpenKalman.
Definition: basics.hpp:34