OpenKalman
nested_object.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 
16 #ifndef OPENKALMAN_NESTED_OBJECT_HPP
17 #define OPENKALMAN_NESTED_OBJECT_HPP
18 
19 
20 namespace OpenKalman
21 {
28 #ifdef __cpp_concepts
29  template<has_nested_object Arg>
30 #else
31  template<typename Arg, std::enable_if_t<has_nested_object<Arg>, int> = 0>
32 #endif
33  constexpr decltype(auto)
34  nested_object(Arg&& arg)
35  {
36  return interface::indexible_object_traits<std::decay_t<Arg>>::template nested_object(std::forward<Arg>(arg));
37  }
38 
39 
40 } // namespace OpenKalman
41 
42 #endif //OPENKALMAN_NESTED_OBJECT_HPP
Definition: indexible_object_traits.hpp:36
The root namespace for OpenKalman.
Definition: basics.hpp:34
decltype(auto) constexpr nested_object(Arg &&arg)
Retrieve a nested object of Arg, if it exists.
Definition: nested_object.hpp:34