17 #ifndef OPENKALMAN_COMPATIBILITY_VIEWS_ALL_HPP 18 #define OPENKALMAN_COMPATIBILITY_VIEWS_ALL_HPP 20 #include <type_traits> 29 #ifdef __cpp_lib_ranges 35 template<
typename R,
typename =
void,
typename =
void>
39 struct can_ref_view<R,
std::enable_if_t<std::is_object_v<stdex::remove_cvref_t<R>> and range<stdex::remove_cvref_t<R>>>,
40 std::void_t<decltype(ref_view {std::declval<R>()})>> : std::true_type {};
45 template<
typename R, std::enable_if_t<viewable_range<R>,
int> = 0>
47 operator() [[nodiscard]] (R&& r)
const 49 if constexpr (view<std::decay_t<R>>)
50 return static_cast<std::decay_t<R>
>(std::forward<R>(r));
52 return ref_view {std::forward<R>(r)};
71 template<
typename R, std::enable_if_t<viewable_range<R>,
int> = 0>
72 using all_t = decltype(
all(std::declval<R>()));
decltype(all(std::declval< R >())) all_t
Equivalent to std::ranges::views::all_t.
Definition: all.hpp:72
Definitions relating to the availability of c++ language features.
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:72
Definition: range_adaptor_closure.hpp:34
Definition: ref_view.hpp:33
decltype(all(std::declval< R >())) all_t
Calculates the suitable collection_view type of a viewable_collection type.
Definition: all.hpp:84
Definition: owning_view.hpp:33