OpenKalman
make_descriptor_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_COORDINATES_MAKE_DESCRIPTOR_RANGE_HPP
17 #define OPENKALMAN_COORDINATES_MAKE_DESCRIPTOR_RANGE_HPP
18 
22 
24 {
30 #ifdef __cpp_concepts
31  template<descriptor...Args>
32  constexpr descriptor_collection auto
33 #else
34  template<typename...Args, std::enable_if_t<(... and descriptor<Args>), int> = 0>
35  constexpr auto
36 #endif
37  make_descriptor_range(Args&&...args)
38  {
39  if constexpr (sizeof...(Args) == 0)
40  return stdex::ranges::views::empty<Dimensions<1>>;
41  else if constexpr (sizeof...(Args) == 1)
42  return stdex::ranges::views::single(std::forward<Args>(args)...);
43  else
44  return std::array {static_cast<stdex::common_reference_t<Args...>>(std::forward<Args>(args))...};
45  }
46 
47 
48 }
49 
50 
51 #endif
constexpr bool descriptor_collection
An object describing a collection of /ref coordinates::descriptor objects.
Definition: descriptor_collection.hpp:72
Definition of the Dimensions class.
constexpr auto make_descriptor_range(Args &&...args)
Make a descriptor_collection from a list of descriptors.
Definition: make_descriptor_range.hpp:37
Definition for coordinates::descriptor.
The namespace for features relating to coordinates::pattern object.
Definition: compares_with.hpp:25
constexpr bool descriptor
T is an atomic (non-separable or non-composite) grouping of coordinates::pattern objects.
Definition: descriptor.hpp:31
Definition for coordinates::descriptor_collection.