OpenKalman
raw_data.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) 2022-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 
17 #ifndef OPENKALMAN_RAW_DATA_HPP
18 #define OPENKALMAN_RAW_DATA_HPP
19 
20 namespace OpenKalman::internal
21 {
22 #ifdef __cpp_lib_concepts
23  namespace detail
24  {
25  template<typename T>
26  concept raw_data_result = requires(T t) { {*t} -> values::scalar; };
27  }
28 #endif
29 
30 
35 #ifdef __cpp_concepts
36  template<interface::raw_data_defined_for Arg>
37  constexpr detail::raw_data_result decltype(auto) raw_data(Arg&& arg)
38 #else
39  template<typename Arg, std::enable_if_t<interface::raw_data_defined_for<Arg>, int> = 0>
40  constexpr decltype(auto) raw_data(Arg&& arg)
41 #endif
42  {
43  return interface::indexible_object_traits<std::decay_t<Arg>>::raw_data(std::forward<Arg>(arg));
44  }
45 
46 
47 } // namespace OpenKalman::internal
48 
49 #endif //OPENKALMAN_RAW_DATA_HPP
Definition: basics.hpp:48