5 #ifndef VCCC_RANGES_VIEWS_JOIN_WITH_HPP_
6 #define VCCC_RANGES_VIEWS_JOIN_WITH_HPP_
32 template<
template<
typename T,
typename...>
class Class,
typename T1,
typename... Ts>
42 template<
typename Pattern>
49 : pattern_(
std::forward<U>(pattern)) {}
72 constexpr decltype(
auto) value_ref() & {
return *pattern_.begin(); }
73 constexpr decltype(
auto) value_ref() const& {
return *pattern_.begin(); }
74 constexpr decltype(
auto) value_ref() && {
return std::move(*pattern_.begin()); }
75 constexpr decltype(
auto) value_ref() const&& {
return std::move(*pattern_.begin()); }
77 template<
typename This,
typename R>
78 constexpr
static auto call(This&& thiz, R&& r, std::true_type) {
79 return join_with_view<all_t<R>, single_view<range_value_t<range_reference_t<R>>>>(
80 std::forward<R>(r), std::forward<This>(thiz).value_ref());
83 template<
typename This,
typename R>
84 constexpr
static auto call(This&& thiz, R&& r, std::false_type) {
85 return join_with_view<all_t<R>, Pattern>{std::forward<R>(r), std::forward<This>(thiz).pattern_};
92 template<
typename R,
typename Pattern, std::enable_if_t<
conjunction<
97 constexpr
auto operator()(R&& r, Pattern&& pattern)
const {
106 std::forward<R>(r), std::move(pattern)};
109 template<
typename Pattern>
115 template<
typename Pattern>
116 constexpr
auto create_closure(Pattern&& pattern, std::true_type )
const {
120 template<
typename Pattern>
121 constexpr
auto create_closure(Pattern&& pattern, std::false_type )
const {
122 return join_with_adaptor<decltype(views::single(std::forward<Pattern>(pattern)))>(std::forward<Pattern>(pattern));
Definition: join_with_view.hpp:173
Definition: single.hpp:38
helper class template for defining a view, using the curiously recurring template pattern
Definition: view_interface.hpp:78
Definition: join_with.hpp:43
constexpr join_with_adaptor(U &&pattern)
Definition: join_with.hpp:48
constexpr auto operator()(R &&r) &&
Definition: join_with.hpp:62
constexpr auto operator()(R &&r) const &
Definition: join_with.hpp:57
constexpr auto operator()(R &&r) const &&
Definition: join_with.hpp:67
constexpr auto operator()(R &&r) &
Definition: join_with.hpp:52
constexpr VCCC_INLINE_OR_STATIC detail::join_with_niebloid join_with
Definition: join_with.hpp:131
typename detail::all_t_impl< R >::type all_t
Calculates the suitable view type of a viewable_range type.
Definition: all.hpp:107
typename range_reference< R >::type range_reference_t
Used to obtain the reference type of the iterator type of range type R.
Definition: range_reference_t.hpp:42
typename range_value< R >::type range_value_t
Used to obtain the value type of the iterator type of range type R.
Definition: range_value_t.hpp:42
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
Definition: matrix.hpp:495
typename first_template_arg< T >::type first_template_arg_t
Definition: join_with.hpp:39
Definition: directory.h:12
constexpr VCCC_INLINE_OR_STATIC detail::element_niebloid< 1 > value
Definition: key_value.hpp:35
Definition: conjunction.hpp:22
specifies that a type is derived from single specialization of CRTP base
Definition: derived_from_single_crtp.hpp:51
Definition: has_typename_type.hpp:18
Definition: is_implicitly_constructible.hpp:23
Definition: negation.hpp:23
helper base class template for defining a range adaptor closure object
Definition: range_adaptor_closure.hpp:96
specifies the requirements for a range to be safely convertible to a view
Definition: viewable_range.hpp:59
T1 type
Definition: join_with.hpp:35
Definition: join_with.hpp:31
Definition: join_with.hpp:91
constexpr auto operator()(R &&r, range_value_t< range_reference_t< R >> pattern) const
Definition: join_with.hpp:104
constexpr auto operator()(R &&r, Pattern &&pattern) const
Definition: join_with.hpp:97
constexpr auto operator()(Pattern &&pattern) const
Definition: join_with.hpp:110