Support Class Library
A set of tools providing classes and utility
Namespaces | Functions
scl::stream::terminators Namespace Reference

Namespace for stream terminal/final operations (eager) More...

Namespaces

 details
 Namespace for implementation details of terminators.
 
 pack
 A namespace for packing operations (getting a result as a container)
 

Functions

template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::remove_cv_ref_t< scl::tools::meta ::arg_t<Fn, 0>>>
details::for_each_toolbox< T > forEach (F callback)
 Invoke a function on each element of a stream. More...
 
template<class T >
details::for_each_toolbox< T > forEach_ (typename details::for_each_toolbox< T >::callback_t cb)
 Invoke a function on each element of a stream by providing the type arguments. More...
 
template<class T >
void operator| (const Stream< T > &lhs, const details::for_each_toolbox< T > &rhs)
 Pipe operator overload for forEach terminators. More...
 
template<class T >
pack::details::SetPacker< T >::result_type operator| (const Stream< T > &lhs, const pack::details::to_set_toolbox &_)
 Pipe operator for packing into a set. More...
 
template<class T , class Compare , class Allocator >
pack::details::SetPacker< T >::result_type operator| (const Stream< T > &lhs, const pack::details::to_set_toolbox_alloc< Compare, Allocator > &_)
 Pipe operator or packing into a set using a specific allocator and comparator. More...
 
template<class T >
pack::details::VectorPacker< T >::result_type operator| (const Stream< T > &lhs, const pack::details::to_vector_toolbox &_)
 Pipe operator for packing into a vector. More...
 
template<class T , class Allocator >
pack::details::VectorPacker< T, Allocator >::result_type operator| (const Stream< T > &lhs, const pack::details::to_vector_toolbox_alloc< Allocator > &_)
 Pipe operator or packing into a vector using a specific allocator. More...
 

Detailed Description

Namespace for stream terminal/final operations (eager)

Function Documentation

◆ forEach()

template<class F , class Fn = decltype( scl::tools::meta ::as_fn(std::declval<F>())), class T = scl::tools::meta ::remove_cv_ref_t< scl::tools::meta ::arg_t<Fn, 0>>>
details::for_each_toolbox<T> scl::stream::terminators::forEach ( callback)

Invoke a function on each element of a stream.

Template Parameters
Fbeing the callback type (deduced)
Fnbeing the function wrapper type (computed)
Tbeing the value type (computed)
Parameters
callbackbeing the callback
Returns
a toolbox tag for pipe operator

Definition at line 94 of file forEach.h.

◆ forEach_()

template<class T >
details::for_each_toolbox<T> scl::stream::terminators::forEach_ ( typename details::for_each_toolbox< T >::callback_t  cb)

Invoke a function on each element of a stream by providing the type arguments.

Template Parameters
Tbeing the value type
Parameters
cbbeing the callback function
Returns
a toolbox tag for pipe operator

Definition at line 105 of file forEach.h.

◆ operator|() [1/5]

template<class T >
pack::details::VectorPacker<T>::result_type scl::stream::terminators::operator| ( const Stream< T > &  lhs,
const pack::details::to_vector_toolbox _ 
)

Pipe operator for packing into a vector.

Template Parameters
Tbeing the value type of the stream
Parameters
lhsbeing the stream to pack
_being the packer type tag
Returns
a vector containing the elements from the stream

Definition at line 89 of file toVector.h.

◆ operator|() [2/5]

template<class T >
pack::details::SetPacker<T>::result_type scl::stream::terminators::operator| ( const Stream< T > &  lhs,
const pack::details::to_set_toolbox _ 
)

Pipe operator for packing into a set.

Template Parameters
Tbeing the value type of the stream
Parameters
lhsbeing the stream to pack
_being the packer type tag
Returns
a set containing the elements from the stream

Definition at line 99 of file toSet.h.

◆ operator|() [3/5]

template<class T , class Allocator >
pack::details::VectorPacker<T, Allocator>::result_type scl::stream::terminators::operator| ( const Stream< T > &  lhs,
const pack::details::to_vector_toolbox_alloc< Allocator > &  _ 
)

Pipe operator or packing into a vector using a specific allocator.

Template Parameters
Tbeing the value type of the stream
Allocatorbeing the type of allocator to use
Parameters
lhsbeing the stream to pack
_being the packer type tag
Returns
a vector containing the elements from the stream

Definition at line 103 of file toVector.h.

◆ operator|() [4/5]

template<class T , class Compare , class Allocator >
pack::details::SetPacker<T>::result_type scl::stream::terminators::operator| ( const Stream< T > &  lhs,
const pack::details::to_set_toolbox_alloc< Compare, Allocator > &  _ 
)

Pipe operator or packing into a set using a specific allocator and comparator.

Template Parameters
Tbeing the value type of the stream
Comparebeing the comparator type
Allocatorbeing the type of allocator to use
Parameters
lhsbeing the stream to pack
_being the packer type tag
Returns
a vector containing the elements from the stream

Definition at line 114 of file toSet.h.

◆ operator|() [5/5]

template<class T >
void scl::stream::terminators::operator| ( const Stream< T > &  lhs,
const details::for_each_toolbox< T > &  rhs 
)

Pipe operator overload for forEach terminators.

Template Parameters
Tbeing the value type
Parameters
lhsbeing the stream to consume
rhsbeing the toolbox tag

Definition at line 116 of file forEach.h.