cxxomfort  rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
Cxxomfort <algorithm> Supplements

cxxomfort Supplementals for <algorithm>

This component provides supplementary features for the set of algorithms present in <algorithm> that are specific to cxxomfort, as well as functions that complete the family of _n functions such as transform_n.

Interfaces defined here:

All interfaces are defined in the namespace cxxomfort::library::algorithm::.

Algorithms on Predicates

Cxxomfort includes the functions all_on() , any_on() , none_on() which are analogues to the std all/any/none_of family of functions. Where the original functions check a predicate f over all elements of a sequence, the new _on functions evalue all predicates on a sequence on an element el.

vector< function<bool(Type)> > functions;
Type elem;
...
if (all_on(begin(functions), end(functions), elem) ) {
... // 'elem' satisfies all checks
}

Experimental

Cxxomfort includes, in namespace cxxomfort::library::algorithm::lfv2:: the following additions from the Library Fundamentals v2 not yet accepted into Standard as of C++17:

Note
The two functions are added generically, instead of providing per-containertype specific overloads as is the case in the Experimental version. This could be fixed in the future, although in the meantime it should not affect things as the functions are in a namespace of their own.

See Also

See also
<algorithm> .
Member cxxomfort::library::algorithm::clamp_halfopen (T const &val, T const &lo, T const &hi, Compare less) CXXO_NOEXCEPT
Member cxxomfort::library::algorithm::copy_if_not (InpI ini, InpI fin, OutI dest, Pred p)
Member cxxomfort::library::algorithm::copy_leftmost_n (Iter1 ini1, Iter1, Integer n, Iter2 ini2)
Member cxxomfort::library::algorithm::copy_rightmost_n (It1 ini1, It1 fin1, Integer n, It2 ini2)
Member cxxomfort::library::algorithm::find (It ini, It fin, Pred if_, T const &v)
Member cxxomfort::library::algorithm::find_if_not (It ini, It fin, Pred if_)
Member cxxomfort::library::algorithm::find_inversion (Iter ini, Iter fin, Less lt)
Member cxxomfort::library::algorithm::find_not (It ini, It fin, T const &t)
Member cxxomfort::library::algorithm::fix_inversion (Iter ini, Iter fin, Less m)
Member cxxomfort::library::algorithm::is_clamped (T const &value, T const &lo, T const &hi, Compare less) CXXO_NOEXCEPTNOTHROW
""
Member cxxomfort::library::algorithm::transform_inplace (FIter ini, FIter fin, TF tf)
""
Member cxxomfort::library::algorithm::transform_inplace_if (FIter ini, FIter fin, TF tf, P p)
Member cxxomfort::library::algorithm::transform_n (IIterator ini, Integer n, OIterator dest, TF tf)