23 #ifndef OPENKALMAN_COMPATIBILITY_VIEWS_ALL_HPP 24 #define OPENKALMAN_COMPATIBILITY_VIEWS_ALL_HPP 26 #ifndef __cpp_lib_ranges 28 #include <type_traits> 39 template<
typename R,
typename =
void,
typename =
void>
43 struct can_ref_view<R,
std::enable_if_t<std::is_object_v<remove_cvref_t<R>> and range<remove_cvref_t<R>>>,
44 std::void_t<decltype(ref_view {std::declval<R>()})>> : std::true_type {};
49 template<
typename R, std::enable_if_t<viewable_range<R>,
int> = 0>
51 operator() [[nodiscard]] (R&& r)
const 53 if constexpr (view<std::decay_t<R>>)
54 return static_cast<std::decay_t<R>
>(std::forward<R>(r));
56 return ref_view {std::forward<R>(r)};
75 template<
typename R, std::enable_if_t<viewable_range<R>,
int> = 0>
76 using all_t = decltype(
all(std::declval<R>()));
83 #endif //OPENKALMAN_COMPATIBILITY_VIEWS_ALL_HPP
Definition: tuple_reverse.hpp:103
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:85
Definition: ref_view.hpp:32
Definition: range_adaptor_closure.hpp:35
Definition: owning_view.hpp:32
decltype(all(std::declval< R >())) all_t
Equivalent to std::ranges::views::all_t.
Definition: all.hpp:76