OpenKalman
pattern_range.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) 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_VECTOR_SPACE_DESCRIPTOR_RANGE_HPP
17 #define OPENKALMAN_VECTOR_SPACE_DESCRIPTOR_RANGE_HPP
18 
19 #ifdef __cpp_lib_ranges
20 #include <ranges>
21 #else
23 #endif
25 #include "pattern.hpp"
26 
28 {
29 #ifndef __cpp_lib_ranges
30  namespace detail
31  {
32  template<typename T, typename = void>
33  struct is_pattern_range : std::false_type {};
34 
35  template<typename T>
36  struct is_pattern_range<T, std::enable_if_t<pattern<ranges::range_value_t<T>>>>
37  : std::true_type {};
38  } // namespace detail
39 #endif
40 
41 
46  template<typename T>
47 #if defined(__cpp_lib_ranges)
48  concept pattern_range = collections::sized_random_access_range<T> and pattern<std::ranges::range_value_t<T>>;
49 #else
50  constexpr bool pattern_range = collections::sized_random_access_range<T> and detail::is_pattern_range<T>::value;
51 #endif
52 
53 
54 } // namespace OpenKalman::coordinates
55 
56 #endif //OPENKALMAN_VECTOR_SPACE_DESCRIPTOR_RANGE_HPP
Definition for collections::sized_random_access_range.
Definition: tuple_reverse.hpp:103
Definition for coordinates::pattern.
Definition: compares_with.hpp:28
constexpr bool pattern_range
An object describing a collection of /ref pattern objects.
Definition: pattern_range.hpp:50
Definitions implementing features of the c++ ranges library for compatibility.