43 const auto& alt = this->
parent()->next().value();
45 const auto& value = *alt;
47 return payload_type::withValue(value);
51 return payload_type::withoutValue();
91 class Fn = decltype(
META::as_fn(std::declval<F>())),
92 class T = META::decay_t<META::arg_t<Fn, 0>>
120 make::ptr<details::FilterOperator<T>>(lhs.
it(), rhs.
pred)
details::filter_toolbox< T > filter(F &&predicate)
Filter a stream.
details::filter_toolbox< T > filter_(typename details::filter_toolbox< T >::pred_t pred)
Filter a stream by explicitly giving the type arguments.
Abstract base class for stream iterators defining the required behavior.
parent_type parent() const
Getter for the parent iterator.
FilterOperator(parent_type p, predicate_type pred)
Construct a filter operation from a parent iterator and a predicate.
Iterator powering an intermediate operation.
StreamIteratorPayload< T > payload_type
Type alias for the payload used.
typename payload_type::value_type value_type
Type alias for the data type manipulated.
bool hasNext() const override
Global namespace of the SCL.
std::function< bool(const value_type &)> predicate_type
The function type used to determine whether to keep the value or not.
it_t it() const
Get a reference to the underlying iterator.
typename iterator_type::parent_type parent_type
std::shared_ptr< parent_iterator_type > parent_type
BaseStreamIterator< T > parent_iterator_type
Type alias for the "parent" iterator.
predicate_type pred
The predicate.
Stream< T > operator|(const Stream< T > &lhs, const details::filter_toolbox< T > &rhs)
Pipe operator overload for filter operations.
typename iterator_type::parent_iterator_type parent_iterator_type
payload_type next() override
Retrieve the next iterator payload.
A class representing a stream iterator's payload.
Class representing a stream of data.