OpenKalman
has_nested_vector.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_HAS_NESTED_VECTOR_HPP
17 #define OPENKALMAN_HAS_NESTED_VECTOR_HPP
18 
20 
21 namespace OpenKalman::internal
22 {
23 #ifndef __cpp_concepts
24  namespace detail
25  {
26  template<typename T, std::size_t N, typename = void>
27  struct has_nested_vector_impl : std::false_type {};
28 
29  template<typename T, std::size_t N>
30  struct has_nested_vector_impl<T, N, std::enable_if_t<has_nested_object<T>>>
31  : std::bool_constant<vector<nested_object_of_t<T>, N>> {};
32  }
33 #endif
34 
35 
41  template<typename T, std::size_t N = 0>
42 #ifdef __cpp_concepts
43  concept has_nested_vector = vector<nested_object_of_t<T>, N>;
44 #else
45  constexpr bool has_nested_vector = detail::has_nested_vector_impl<T, N>::value;
46 #endif
47 
48 
49 }
50 
51 #endif
Definition: has_nested_vector.hpp:27
constexpr bool has_nested_vector
Specifies that a type is a wrapper containing a nested vector.
Definition: has_nested_vector.hpp:45
Definition for nested_object_of.
Definition: basics.hpp:48