OpenKalman
nested_object_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_NESTED_OBJECT_OF_HPP
17 #define OPENKALMAN_NESTED_OBJECT_OF_HPP
18 
19 
20 namespace OpenKalman
21 {
28 #ifdef __cpp_concepts
29  template<typename T>
30 #else
31  template<typename T, typename = void>
32 #endif
34 
35 
36 #ifdef __cpp_concepts
37  template<typename T>
38 #else
39  template<typename T, typename>
40 #endif
41  struct nested_object_of {};
42 
43 
44 #ifdef __cpp_concepts
45  template<has_nested_object T>
46  struct nested_object_of<T>
47 #else
48  template<typename T>
49  struct nested_object_of<T, std::enable_if_t<has_nested_object<T>>>
50 #endif
51  {
52  using type = decltype(interface::indexible_object_traits<std::decay_t<T>>::nested_object(std::declval<T>()));
53  };
54 
55 
61 #ifdef __cpp_concepts
62  template<has_nested_object T>
63 #else
64  template<typename T>
65 #endif
67 
68 
69 } // namespace OpenKalman
70 
71 #endif //OPENKALMAN_NESTED_OBJECT_OF_HPP
typename nested_object_of< T >::type nested_object_of_t
Helper type for nested_object_of.
Definition: nested_object_of.hpp:66
Definition: indexible_object_traits.hpp:36
Definition: tuple_reverse.hpp:103
A wrapper type&#39;s nested object type, if it exists.
Definition: nested_object_of.hpp:33
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