OpenKalman
sized_random_access_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) 2024-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_COLLECTIONS_SIZED_RANDOM_ACCESS_RANGE_HPP
17 #define OPENKALMAN_COLLECTIONS_SIZED_RANDOM_ACCESS_RANGE_HPP
18 
19 #include <type_traits>
20 #ifdef __cpp_lib_ranges
21 #include <ranges>
22 #else
24 #endif
25 #include "sized.hpp"
26 
28 {
32 #if defined(__cpp_concepts) and defined(__cpp_lib_remove_cvref)
33  template<typename T>
34  concept sized_random_access_range = std::ranges::random_access_range<std::remove_cvref_t<T>> and sized<T>;
35 #else
36  template<typename T>
37  constexpr bool sized_random_access_range = ranges::random_access_range<remove_cvref_t<T>> and sized<T>;
38 #endif
39 
40 } // OpenKalman::collections
41 
42 #endif //OPENKALMAN_COLLECTIONS_SIZED_RANDOM_ACCESS_RANGE_HPP
Namespace for collections.
Definition: collections.hpp:27
constexpr bool sized_random_access_range
A sized random access range.
Definition: sized_random_access_range.hpp:37
Definition for collections::sized.
Definitions implementing features of the c++ ranges library for compatibility.