OpenKalman
global-definitions.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) 2021-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_GLOBAL_DEFINITIONS_HPP
17 #define OPENKALMAN_GLOBAL_DEFINITIONS_HPP
18 
19 #include <type_traits>
20 #include <functional>
21 
22 namespace OpenKalman::internal
23 {
24  // ----------------------- //
25  // is_plus, is_multiplies //
26  // ----------------------- //
27 
28  template<typename T>
29  struct is_plus : std::false_type {};
30 
31  template<typename T>
32  struct is_plus<std::plus<T>> : std::true_type {};
33 
34  template<typename T>
35  struct is_multiplies : std::false_type {};
36 
37  template<typename T>
38  struct is_multiplies<std::multiplies<T>> : std::true_type {};
39 
40 
41  // ------------------------ //
42  // remove_rvalue_reference //
43  // ------------------------ //
44 
48  template<typename T>
49  struct remove_rvalue_reference { using type = T; };
50 
51 
53  template<typename T>
54  struct remove_rvalue_reference<T&&> { using type = T; };
55 
56 
60  template<typename T>
61  using remove_rvalue_reference_t = typename remove_rvalue_reference<T>::type;
62 
63 }
64 
65 #endif
If T is an rvalue reference, remove the reference.
Definition: global-definitions.hpp:49
typename remove_rvalue_reference< T >::type remove_rvalue_reference_t
Helper type for remove_rvalue_reference.
Definition: global-definitions.hpp:61
Definition: global-definitions.hpp:35
Definition: global-definitions.hpp:29
Definition: basics.hpp:48