17 #ifndef OPENKALMAN_COLLECTIONS_VIEWS_ALL_HPP 18 #define OPENKALMAN_COLLECTIONS_VIEWS_ALL_HPP 20 #ifdef __cpp_lib_ranges 36 #if __cpp_lib_ranges >= 202202L
37 : std::ranges::range_adaptor_closure<all_closure>
43 template<viewable_collection R>
46 template<
typename R, std::enable_if_t<viewable_collection<R>,
int> = 0>
49 operator() [[nodiscard]] (R&& r)
const 52 if constexpr (collection_view<R>)
54 return static_cast<std::decay_t<R>
>(std::forward<R>(r));
56 else if constexpr (uniform_tuple_like<R>)
58 if constexpr (size_of_v<R> == 1)
59 #ifdef __cpp_lib_ranges 60 return std::ranges::views::single(OpenKalman::internal::generalized_std_get<0>(std::forward<R>(r)));
62 return ranges::views::single(OpenKalman::internal::generalized_std_get<0>(std::forward<R>(r)));
68 return to_tuple {std::forward<R>(r)};
93 template<viewable_collection R>
95 template<
typename R, std::enable_if_t<viewable_collection<R>,
int> = 0>
97 using all_t = decltype(
all(std::declval<R>()));
102 #endif //OPENKALMAN_COLLECTIONS_VIEWS_ALL_HPP A collection_view created from a std::ranges::random_access_range that is a std::ranges::viewable_ran...
Definition: to_tuple.hpp:139
Definition: tuple_reverse.hpp:103
constexpr detail::all_closure all
a std::ranges::range_adaptor_closure which returns a view to all members of its collection argument...
Definition: all.hpp:85
constexpr bool collection_view
A view to a collection which is also a std::ranges:view.
Definition: collection_view.hpp:36
A collection_view created from a uniform_tuple_like object.
Definition: from_tuple.hpp:75
Namespace for generalized views.
Definition: collections.hpp:33
Definition for collections::to_tuple.
Definitions implementing features of the c++ ranges library for compatibility.
Definition for collections::from_tuple.
Definition for collections::viewable_collection.
decltype(all(std::declval< R >())) all_t
Calculates the suitable collection_view type of a viewable_collection type.
Definition: all.hpp:97