18 template <
class T,
class U>
34 using mapper_type = std::function<value_type(const parent_value_type&)>;
45 auto alt = this->
parent()->next().value();
48 ? payload_type::withValue(this->
mapper(*alt))
49 : payload_type::withoutValue();
65 template <
class T,
class U>
93 class Fn = decltype(
META::as_fn(std::declval<F>())),
94 class T = META::decay_t<META::arg_t<Fn, 0>>,
95 class U = META::decay_t<META::return_t<Fn>>
108 template<
class T,
class U = T>
119 template <
class T,
class U>
123 make::ptr<details::MapOperator<T, U>>(lhs.
it(), rhs.
mapper)
typename iterator_type::parent_iterator_type parent_iterator_type
parent_type parent() const
Getter for the parent iterator.
Iterator powering an intermediate operation.
typename iterator_type::payload_type payload_type
typename iterator_type::parent_type parent_type
StreamIteratorPayload< U > payload_type
Type alias for the payload used.
typename payload_type::value_type value_type
Type alias for the data type manipulated.
Global namespace of the SCL.
it_t it() const
Get a reference to the underlying iterator.
details::map_toolbox< T, U > map_(typename details::map_toolbox< T, U >::mapper_t mapper)
Map a stream by explicitly providing the type arguments.
typename parent_iterator_type::payload_type parent_payload_type
mapper_type mapper
the function used to map values from the parent iterator
payload_type next() override
Retrieve the next iterator payload.
std::shared_ptr< parent_iterator_type > parent_type
BaseStreamIterator< T > parent_iterator_type
Type alias for the "parent" iterator.
Stream< T > operator|(const Stream< T > &lhs, const details::filter_toolbox< T > &rhs)
Pipe operator overload for filter operations.
std::function< value_type(const parent_value_type &)> mapper_type
Function type that maps the parent value type to the current value type.
typename parent_iterator_type::value_type parent_value_type
details::map_toolbox< T, U > map(F &&mapper)
Map a stream.
MapOperator(parent_type p, mapper_type mapper)
Construct the operator from the parent iterator and a mapper function.
typename iterator_type::value_type value_type
Class representing a stream of data.