OpenKalman
viewable_collection.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_COLLECTIONS_VIEWABLE_COLLECTION_HPP
17 #define OPENKALMAN_COLLECTIONS_VIEWABLE_COLLECTION_HPP
18 
19 #ifdef __cpp_lib_ranges
20 #include <ranges>
21 #else
23 #endif
24 #include "uniform_tuple_like.hpp"
25 
27 {
32  template<typename T>
33 #ifdef __cpp_lib_ranges
34  concept viewable_collection = (std::ranges::random_access_range<T> and
35  (std::ranges::view<std::remove_cvref_t<T>> or std::ranges::viewable_range<T>)) or uniform_tuple_like<T>;
36 #else
37  constexpr bool viewable_collection = (ranges::random_access_range<T> and
38  (ranges::view<remove_cvref_t<T>> or ranges::viewable_range<T>)) or uniform_tuple_like<T>;
39 #endif
40 
41 
42 } // namespace OpenKalman
43 
44 #endif //OPENKALMAN_COLLECTIONS_VIEWABLE_COLLECTION_HPP
Namespace for collections.
Definition: collections.hpp:27
constexpr bool viewable_collection
A std::range or uniform_tuple_like object that can be converted into a collection_view by passing it ...
Definition: viewable_collection.hpp:37
Definition for collections::uniform_tuple_like.