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-2025 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 
20 
21 namespace OpenKalman
22 {
29 #ifdef __cpp_concepts
30  template<typename T>
31 #else
32  template<typename T, typename = void>
33 #endif
34  struct nested_object_of {};
35 
36 
37 #ifdef __cpp_concepts
38  template<has_nested_object T>
39  struct nested_object_of<T>
40 #else
41  template<typename T>
42  struct nested_object_of<T, std::enable_if_t<has_nested_object<T>>>
43 #endif
44  {
45  using type = decltype(interface::object_traits<stdex::remove_cvref_t<T>>::nested_object(std::declval<T>()));
46  };
47 
48 
53 #ifdef __cpp_concepts
54  template<has_nested_object T>
55 #else
56  template<typename T>
57 #endif
59 
60 
61 }
62 
63 #endif
typename nested_object_of< T >::type nested_object_of_t
Helper type for nested_object_of.
Definition: nested_object_of.hpp:58
A wrapper type&#39;s nested object type, if it exists.
Definition: nested_object_of.hpp:34
The root namespace for OpenKalman.
Definition: basics.hpp:34
Definition: object_traits.hpp:38
Definition for has_nested_object.
decltype(auto) constexpr nested_object(Arg &&arg)
Retrieve a nested object of Arg, if it exists.
Definition: nested_object.hpp:35