Skip to content

batt::seq

batt::seq🔗

Namespaces🔗

Name
batt::seq::detail

Classes🔗

Name
struct batt::seq::WriteToBinder
struct batt::seq::Addition
struct batt::seq::AllBinder
struct batt::seq::AnyBinder
struct batt::seq::ApplyBinder
class batt::seq::Attach
struct batt::seq::AttachBinder
struct batt::seq::BoxedBinder
class batt::seq::CacheNext
struct batt::seq::CacheNextBinder
class batt::seq::Chain
struct batt::seq::ChainBinder
struct batt::seq::Collect
struct batt::seq::CollectVec
struct batt::seq::Consume
struct batt::seq::CountBinder
struct batt::seq::DecayItem
struct batt::seq::Deref
class batt::seq::Empty
class batt::seq::Filter
struct batt::seq::FilterBinder
struct batt::seq::IsNotFalse
class batt::seq::FilterMap
struct batt::seq::FilterMapBinder
struct batt::seq::FirstBinder
class batt::seq::Flatten
struct batt::seq::FlattenBinder
struct batt::seq::ForEachBinder
class batt::seq::Fuse
struct batt::seq::FuseBinder
class batt::seq::GroupBy
struct batt::seq::GroupByBinder
struct batt::seq::InnerReduceBinder
class batt::seq::InspectAdjacent
struct batt::seq::InspectAdjacentBinder
struct batt::seq::IsSortedBinder
class batt::seq::KMergeBy
struct batt::seq::KMergeByBinder
struct batt::seq::LastBinder
class batt::seq::Lazy
class batt::seq::Map
struct batt::seq::MapBinder
class batt::seq::MapAdjacent
struct batt::seq::MapAdjacentBinder
class batt::seq::MapFold
struct batt::seq::MapFoldBinder
class batt::seq::MapPairwise
struct batt::seq::MapPairwiseBinder
class batt::seq::MergeBy
struct batt::seq::MergeByBinder
struct batt::seq::NaturalEquals
struct batt::seq::NaturalOrder
struct batt::seq::PrependBinder
struct batt::seq::PrintOut
class batt::seq::Printable
struct batt::seq::PrintableBinder
struct batt::seq::ProductBinder
struct batt::seq::ReduceBinder
struct batt::seq::Reverse
struct batt::seq::RollingBinder
struct batt::seq::RollingSumBinder
class batt::seq::Splice
struct batt::seq::SpliceBinder
class batt::seq::StatusOk
struct batt::seq::StatusOkBinder
struct batt::seq::SumBinder
struct batt::seq::TakeNBinder
class batt::seq::TakeN
class batt::seq::TakeWhile
struct batt::seq::TakeWhileBinder
class batt::seq::Zip
struct batt::seq::ZipBinder
class batt::seq::SingleItem

Types🔗

Name
enum LoopControl { kContinue = 0, kBreak = 1}

Functions🔗

Name
template <typename AsyncWriteStream >
auto
write_to(AsyncWriteStream && dst)
AllBinder all_true()
template <typename Seq >
auto
**[operator
AnyBinder any_true()
template <typename Seq >
auto
**[operator
template <typename SeqFn >
ApplyBinder< SeqFn >
apply(SeqFn && seq_fn)
template <typename Seq ,typename SeqFn >
decltype(auto)
**[operator
template <typename D >
AttachBinder< D >
attach(D && data)
template <typename Seq ,typename D >
auto
**[operator
BoxedBinder boxed()
template <typename Seq ,typename =EnableIfSeq,typename Item =typename std::conditional_t(), SeqItem_Impl\, StaticType\>::type>
BoxedSeq< Item >
**[operator
CacheNextBinder cache_next()
template <typename Seq >
auto
**[operator
template <typename Seq2 >
ChainBinder< Seq2 >
chain(Seq2 && seq2)
template <typename Seq1 ,typename Seq2 >
Chain< Seq1, Seq2 >
**[operator
template <typename T >
Collect< T >
collect(StaticType< T > ={})
template <typename Seq ,typename T >
auto
**[operator
CollectVec collect_vec()
template <typename Seq ,typename =EnableIfSeq>
auto
**[operator
auto consume()
template <typename Seq ,typename =EnableIfSeq>
void
**[operator
CountBinder count()
template <typename Seq >
BATT_MAYBE_UNUSED usize
**[operator
auto decayed()
auto deref()
template <typename Container >
auto
emplace_back(Container * dst)
template <typename Predicate >
FilterBinder< Predicate >
filter(Predicate && predicate)
template <typename Seq ,typename Predicate >
Filter< Seq, Predicate >
**[operator
template <typename Seq ,typename Fn >
auto
filter_map_impl(Seq && seq, Fn && fn)
template <typename Fn >
FilterMapBinder< Fn >
filter_map(Fn && fn)
template <typename Seq ,typename Fn >
FilterMap< Seq, Fn >
**[operator
FirstBinder first()
template <typename Seq >
auto
**[operator
FlattenBinder flatten()
template <typename OuterSeq >
Flatten< OuterSeq >
**[operator
template <typename Fn >
ForEachBinder< Fn >
for_each(Fn && fn)
template <typename Seq ,typename Fn ,typename =EnableIfSeq>
LoopControl
**[operator
FuseBinder fuse()
template <typename Seq >
Fuse< Seq >
**[operator
template <typename GroupEq >
GroupByBinder< GroupEq >
group_by(GroupEq && group_eq)
template <typename Seq ,typename GroupEq >
GroupBy< Seq, GroupEq >
**[operator
template <typename ReduceFn >
InnerReduceBinder< ReduceFn >
inner_reduce(ReduceFn && reduce_fn)
template <typename Seq ,typename ReduceFn >
Optional< std::decay_t< SeqItem< Seq > > >
**[operator
template <typename Fn >
auto
inspect(Fn && fn)
template <typename Fn >
InspectAdjacentBinder< Fn >
inspect_adjacent(Fn && fn)
template <typename Seq ,typename Fn >
InspectAdjacent< Seq, Fn >
**[operator
template <typename Compare >
IsSortedBinder< Compare >
is_sorted_by(Compare && compare)
auto is_sorted()
template <typename Seq ,typename Compare >
bool
**[operator
template <typename Compare >
KMergeByBinder< Compare >
kmerge_by(Compare && compare)
auto kmerge()
template <typename KSeqs ,typename Compare >
KMergeBy< SeqItem< KSeqs >, Compare >
**[operator
LastBinder last()
template <typename Seq >
auto
**[operator
template <typename Fn >
auto
lazy(Fn && fn)
template <typename Fn ,typename... Args,typename =std::enable_if_t, LoopControl>>>
LoopControl
run_loop_fn(Fn && fn, Args &&... args)
template <typename Fn ,typename... Args,typename =std::enable_if_t<!std::is_convertible_v, LoopControl>>,typename =void>
LoopControl
run_loop_fn(Fn && fn, Args &&... args)
template <typename MapFn >
MapBinder< MapFn >
map(MapFn && map_fn)
template <typename Seq ,typename MapFn >
Map< Seq, MapFn >
**[operator
template <typename Fn >
MapAdjacentBinder< Fn >
map_adjacent(Fn && fn)
template <typename Seq ,typename Fn >
MapAdjacent< Seq, Fn >
**[operator
template <typename State ,typename MapFn >
MapFoldBinder< State, MapFn >
map_fold(State && state, MapFn && map_fn)
template <typename Seq ,typename State ,typename MapFn >
MapFold< Seq, State, MapFn >
**[operator
template <typename RightSeq ,typename MapFn >
MapPairwiseBinder< RightSeq, MapFn >
map_pairwise(RightSeq && right, MapFn && map_fn)
template <typename LeftSeq ,typename RightSeq ,typename MapFn >
MapPairwise< LeftSeq, RightSeq, MapFn >
**[operator
template <typename Compare ,typename RightSeq >
MergeByBinder< RightSeq, Compare >
merge_by(Compare && compare, RightSeq && right)
template <typename RightSeq >
auto
merge(RightSeq && right)
template <typename LeftSeq ,typename RightSeq ,typename Compare >
MergeBy< LeftSeq, RightSeq, Compare >
**[operator
template <typename Item >
auto
prepend(Item && item)
auto print_out(std::ostream & out, std::string_view sep =" ")
template <typename Seq ,typename =EnableIfSeq>
auto
**[operator
auto debug_out(std::ostream & out, std::string_view sep =" ")
PrintableBinder printable()
template <typename Seq >
auto
**[operator
ProductBinder product()
template <typename Seq >
auto
**[operator
template <typename State ,typename ReduceFn >
ReduceBinder< State, ReduceFn >
reduce(State && state, ReduceFn && reduce_fn)
template <typename Seq ,typename State ,typename ReduceFn >
State
**[operator
template <typename T ,typename BinaryFn >
RollingBinder< T, BinaryFn >
rolling(BinaryFn && binary_fn, T && initial =T{})
template <typename Seq ,typename T ,typename BinaryFn >
auto
**[operator
RollingSumBinder rolling_sum()
template <typename Seq >
auto
**[operator
auto running_total()
template <typename InnerSeq >
SpliceBinder< InnerSeq >
splice(usize n, InnerSeq && inner_seq)
template <typename OuterSeq ,typename InnerSeq >
auto
**[operator
auto status_ok()
template <typename SeqT >
StatusOk< SeqT >
**[operator
SumBinder sum()
template <typename Seq >
auto
**[operator
TakeNBinder take_n(usize n)
template <typename Seq ,typename =EnableIfSeq>
TakeN< Seq >
**[operator
template <typename Predicate >
TakeWhileBinder< Predicate >
take_while(Predicate && predicate)
template <typename Seq ,typename Predicate >
TakeWhile< Seq, Predicate >
**[operator
template <typename... OtherSeqs>
ZipBinder< OtherSeqs &&... >
zip(OtherSeqs &&... other_seqs)
template <typename Seq ,typename... OtherSeqs>
Zip< Seq, OtherSeqs... >
**[operator
template <typename T >
SingleItem< T >
single_item(T && item)

Types Documentation🔗

enum LoopControl🔗

Enumerator Value Description
kContinue 0
kBreak 1

Functions Documentation🔗

function write_to🔗

1
2
3
4
template <typename AsyncWriteStream >
inline auto write_to(
    AsyncWriteStream && dst
)

function all_true🔗

inline AllBinder all_true()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    AllBinder 
)

function any_true🔗

inline AnyBinder any_true()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    AnyBinder 
)

function apply🔗

1
2
3
4
template <typename SeqFn >
inline ApplyBinder< SeqFn > apply(
    SeqFn && seq_fn
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename SeqFn >
inline decltype(auto) operator|(
    Seq && seq,
    ApplyBinder< SeqFn > && binder
)

function attach🔗

1
2
3
4
template <typename D >
inline AttachBinder< D > attach(
    D && data
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename D >
inline auto operator|(
    Seq && seq,
    AttachBinder< D > && binder
)

function boxed🔗

inline BoxedBinder boxed()

function operator|🔗

1
2
3
4
5
6
7
template <typename Seq ,
typename  =EnableIfSeq<Seq>,
typename Item  =typename std::conditional_t<has_seq_requirements<Seq>(),                                                   SeqItem_Impl<Seq>,  StaticType<void>>::type>
inline BoxedSeq< Item > operator|(
    Seq && seq,
    BoxedBinder 
)

function cache_next🔗

inline CacheNextBinder cache_next()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    CacheNextBinder 
)

function chain🔗

1
2
3
4
template <typename Seq2 >
ChainBinder< Seq2 > chain(
    Seq2 && seq2
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq1 ,
typename Seq2 >
Chain< Seq1, Seq2 > operator|(
    Seq1 && seq1,
    ChainBinder< Seq2 > && binder
)

function collect🔗

1
2
3
4
template <typename T >
inline Collect< T > collect(
    StaticType< T >  ={}
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename T >
auto operator|(
    Seq && seq,
    Collect< T > 
)

function collect_vec🔗

inline CollectVec collect_vec()

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename  =EnableIfSeq<Seq>>
auto operator|(
    Seq && seq,
    CollectVec 
)

function consume🔗

inline auto consume()

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename  =EnableIfSeq<Seq>>
void operator|(
    Seq && seq,
    Consume && 
)

function count🔗

inline CountBinder count()

function operator|🔗

1
2
3
4
5
template <typename Seq >
BATT_MAYBE_UNUSED usize operator|(
    Seq && seq,
    CountBinder 
)

function decayed🔗

inline auto decayed()

function deref🔗

inline auto deref()

function emplace_back🔗

1
2
3
4
template <typename Container >
inline auto emplace_back(
    Container * dst
)

function filter🔗

1
2
3
4
template <typename Predicate >
FilterBinder< Predicate > filter(
    Predicate && predicate
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename Predicate >
Filter< Seq, Predicate > operator|(
    Seq && seq,
    FilterBinder< Predicate > && binder
)

function filter_map_impl🔗

1
2
3
4
5
6
template <typename Seq ,
typename Fn >
auto filter_map_impl(
    Seq && seq,
    Fn && fn
)

function filter_map🔗

1
2
3
4
template <typename Fn >
FilterMapBinder< Fn > filter_map(
    Fn && fn
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename Fn >
FilterMap< Seq, Fn > operator|(
    Seq && seq,
    FilterMapBinder< Fn > && binder
)

function first🔗

inline FirstBinder first()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    FirstBinder 
)

function flatten🔗

inline FlattenBinder flatten()

function operator|🔗

1
2
3
4
5
template <typename OuterSeq >
Flatten< OuterSeq > operator|(
    OuterSeq && seq,
    FlattenBinder 
)

function for_each🔗

1
2
3
4
template <typename Fn >
ForEachBinder< Fn > for_each(
    Fn && fn
)

function operator|🔗

1
2
3
4
5
6
7
template <typename Seq ,
typename Fn ,
typename  =EnableIfSeq<Seq>>
LoopControl operator|(
    Seq && seq,
    ForEachBinder< Fn > && binder
)

function fuse🔗

inline FuseBinder fuse()

function operator|🔗

1
2
3
4
5
template <typename Seq >
Fuse< Seq > operator|(
    Seq && seq,
    FuseBinder 
)

function group_by🔗

1
2
3
4
template <typename GroupEq >
GroupByBinder< GroupEq > group_by(
    GroupEq && group_eq
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename GroupEq >
GroupBy< Seq, GroupEq > operator|(
    Seq && seq,
    GroupByBinder< GroupEq > && binder
)

function inner_reduce🔗

1
2
3
4
template <typename ReduceFn >
InnerReduceBinder< ReduceFn > inner_reduce(
    ReduceFn && reduce_fn
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename ReduceFn >
Optional< std::decay_t< SeqItem< Seq > > > operator|(
    Seq && seq,
    InnerReduceBinder< ReduceFn > binder
)

function inspect🔗

1
2
3
4
template <typename Fn >
auto inspect(
    Fn && fn
)

function inspect_adjacent🔗

1
2
3
4
template <typename Fn >
InspectAdjacentBinder< Fn > inspect_adjacent(
    Fn && fn
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename Fn >
InspectAdjacent< Seq, Fn > operator|(
    Seq && seq,
    InspectAdjacentBinder< Fn > && binder
)

function is_sorted_by🔗

1
2
3
4
template <typename Compare >
IsSortedBinder< Compare > is_sorted_by(
    Compare && compare
)

function is_sorted🔗

inline auto is_sorted()

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename Compare >
inline bool operator|(
    Seq && seq,
    IsSortedBinder< Compare > && binder
)

function kmerge_by🔗

1
2
3
4
template <typename Compare >
KMergeByBinder< Compare > kmerge_by(
    Compare && compare
)

function kmerge🔗

inline auto kmerge()

function operator|🔗

1
2
3
4
5
6
template <typename KSeqs ,
typename Compare >
KMergeBy< SeqItem< KSeqs >, Compare > operator|(
    KSeqs && k_seqs,
    KMergeByBinder< Compare > && binder
)

function last🔗

inline LastBinder last()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    LastBinder 
)

function lazy🔗

1
2
3
4
template <typename Fn >
auto lazy(
    Fn && fn
)

function run_loop_fn🔗

1
2
3
4
5
6
7
template <typename Fn ,
typename... Args,
typename  =std::enable_if_t<std::is_convertible_v<std::invoke_result_t<Fn&&, Args&&...>, LoopControl>>>
LoopControl run_loop_fn(
    Fn && fn,
    Args &&... args
)

function run_loop_fn🔗

1
2
3
4
5
6
7
8
template <typename Fn ,
typename... Args,
typename  =std::enable_if_t<!std::is_convertible_v<std::invoke_result_t<Fn&&, Args&&...>, LoopControl>>,
typename  =void>
LoopControl run_loop_fn(
    Fn && fn,
    Args &&... args
)

function map🔗

1
2
3
4
template <typename MapFn >
MapBinder< MapFn > map(
    MapFn && map_fn
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename MapFn >
Map< Seq, MapFn > operator|(
    Seq && seq,
    MapBinder< MapFn > && binder
)

function map_adjacent🔗

1
2
3
4
template <typename Fn >
MapAdjacentBinder< Fn > map_adjacent(
    Fn && fn
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename Fn >
MapAdjacent< Seq, Fn > operator|(
    Seq && seq,
    MapAdjacentBinder< Fn > && binder
)

function map_fold🔗

1
2
3
4
5
6
template <typename State ,
typename MapFn >
MapFoldBinder< State, MapFn > map_fold(
    State && state,
    MapFn && map_fn
)

function operator|🔗

1
2
3
4
5
6
7
template <typename Seq ,
typename State ,
typename MapFn >
MapFold< Seq, State, MapFn > operator|(
    Seq && seq,
    MapFoldBinder< State, MapFn > && binder
)

function map_pairwise🔗

1
2
3
4
5
6
template <typename RightSeq ,
typename MapFn >
MapPairwiseBinder< RightSeq, MapFn > map_pairwise(
    RightSeq && right,
    MapFn && map_fn
)

function operator|🔗

1
2
3
4
5
6
7
template <typename LeftSeq ,
typename RightSeq ,
typename MapFn >
MapPairwise< LeftSeq, RightSeq, MapFn > operator|(
    LeftSeq && left,
    MapPairwiseBinder< RightSeq, MapFn > && binder
)

function merge_by🔗

1
2
3
4
5
6
template <typename Compare ,
typename RightSeq >
MergeByBinder< RightSeq, Compare > merge_by(
    Compare && compare,
    RightSeq && right
)

function merge🔗

1
2
3
4
template <typename RightSeq >
auto merge(
    RightSeq && right
)

function operator|🔗

1
2
3
4
5
6
7
template <typename LeftSeq ,
typename RightSeq ,
typename Compare >
MergeBy< LeftSeq, RightSeq, Compare > operator|(
    LeftSeq && left,
    MergeByBinder< RightSeq, Compare > && binder
)

function prepend🔗

1
2
3
4
template <typename Item >
inline auto prepend(
    Item && item
)

function print_out🔗

1
2
3
4
inline auto print_out(
    std::ostream & out,
    std::string_view sep =" "
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename  =EnableIfSeq<Seq>>
inline auto operator|(
    Seq && seq,
    PrintOut p
)

function debug_out🔗

1
2
3
4
inline auto debug_out(
    std::ostream & out,
    std::string_view sep =" "
)

function printable🔗

inline PrintableBinder printable()

function operator|🔗

1
2
3
4
5
template <typename Seq >
inline auto operator|(
    Seq && seq,
    PrintableBinder 
)

function product🔗

inline ProductBinder product()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    ProductBinder 
)

function reduce🔗

1
2
3
4
5
6
template <typename State ,
typename ReduceFn >
ReduceBinder< State, ReduceFn > reduce(
    State && state,
    ReduceFn && reduce_fn
)

function operator|🔗

1
2
3
4
5
6
7
template <typename Seq ,
typename State ,
typename ReduceFn >
State operator|(
    Seq && seq,
    ReduceBinder< State, ReduceFn > binder
)

function rolling🔗

1
2
3
4
5
6
template <typename T ,
typename BinaryFn >
inline RollingBinder< T, BinaryFn > rolling(
    BinaryFn && binary_fn,
    T && initial =T{}
)

function operator|🔗

1
2
3
4
5
6
7
template <typename Seq ,
typename T ,
typename BinaryFn >
auto operator|(
    Seq && seq,
    RollingBinder< T, BinaryFn > && binder
)

function rolling_sum🔗

inline RollingSumBinder rolling_sum()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    RollingSumBinder 
)

function running_total🔗

inline auto running_total()

function splice🔗

1
2
3
4
5
template <typename InnerSeq >
inline SpliceBinder< InnerSeq > splice(
    usize n,
    InnerSeq && inner_seq
)

function operator|🔗

1
2
3
4
5
6
template <typename OuterSeq ,
typename InnerSeq >
auto operator|(
    OuterSeq && outer_seq,
    SpliceBinder< InnerSeq > && binder
)

function status_ok🔗

inline auto status_ok()

function operator|🔗

1
2
3
4
5
template <typename SeqT >
inline StatusOk< SeqT > operator|(
    SeqT && seq,
    StatusOkBinder 
)

function sum🔗

inline SumBinder sum()

function operator|🔗

1
2
3
4
5
template <typename Seq >
auto operator|(
    Seq && seq,
    SumBinder 
)

function take_n🔗

1
2
3
inline TakeNBinder take_n(
    usize n
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename  =EnableIfSeq<Seq>>
TakeN< Seq > operator|(
    Seq && seq,
    const TakeNBinder & binder
)

function take_while🔗

1
2
3
4
template <typename Predicate >
TakeWhileBinder< Predicate > take_while(
    Predicate && predicate
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename Predicate >
TakeWhile< Seq, Predicate > operator|(
    Seq && seq,
    TakeWhileBinder< Predicate > && binder
)

function zip🔗

1
2
3
4
template <typename... OtherSeqs>
ZipBinder< OtherSeqs &&... > zip(
    OtherSeqs &&... other_seqs
)

function operator|🔗

1
2
3
4
5
6
template <typename Seq ,
typename... OtherSeqs>
Zip< Seq, OtherSeqs... > operator|(
    Seq && seq,
    ZipBinder< OtherSeqs &&... > && binder
)

function single_item🔗

1
2
3
4
template <typename T >
SingleItem< T > single_item(
    T && item
)

Updated on 31 January 2025 at 21:21:04 UTC