OpenKalman
patterns_may_match_with.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_PATTERNS_MAY_MATCH_WITH_HPP
17 #define OPENKALMAN_PATTERNS_MAY_MATCH_WITH_HPP
18 
19 #include "coordinates/coordinates.hpp"
21 
22 namespace OpenKalman
23 {
24  namespace detail
25  {
26  template<typename...Ps>
27  struct patterns_may_match_with_impl : std::true_type {};
28 
29  template<typename P, typename...Ps>
31  : std::bool_constant<(... and (coordinates::pattern_collection_compares_with<P, Ps, &stdex::is_eq, applicability::permitted>))> {};
32 
33 #ifndef __cpp_concepts
34  template<typename = void, typename...Ts>
35  struct pattern_mch : std::false_type {};
36 
37  template<typename...Ts>
38  struct pattern_mch<std::enable_if_t<
39  patterns_may_match_with_impl<decltype(get_pattern_collection(std::declval<Ts>()))...>::value>, Ts...>
40  : std::true_type {};
41 #endif
42  }
43 
44 
51  template<typename...Ts>
52 #ifdef __cpp_concepts
53  concept patterns_may_match_with =
54  (indexible<Ts> and ...) and
56 #else
57  constexpr bool patterns_may_match_with =
58  (indexible<Ts> and ...) and
59  detail::pattern_mch<void, Ts...>::value;
60 #endif
61 
62 
63 }
64 
65 #endif
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
The root namespace for OpenKalman.
Definition: basics.hpp:34
constexpr bool patterns_may_match_with
Specifies that indexible objects Ts may have equivalent dimensions and vector-space types...
Definition: patterns_may_match_with.hpp:57
Definition: patterns_may_match_with.hpp:27
Definition of get_pattern_collection function.
Definition: patterns_may_match_with.hpp:35