Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
util-coll.hpp File Reference

Some small helpers and convenience shortcuts to ease working with collections and sequences (given by iterator). More...

Go to the source code of this file.

Description

Some small helpers and convenience shortcuts to ease working with collections and sequences (given by iterator).

Mostly, these are tiny bits of existing functionality, just packaged in a more fluent and readable way.

Warning
some functions only available when including itertools.hpp beforehand
See also
util-collection-test.cpp
util-foreach.hpp

Definition in file util-coll.hpp.

#include "lib/util.hpp"
#include "lib/meta/trait.hpp"
#include <limits>

Namespaces

namespace  util
 
namespace  util::anonymous_namespace{util-coll.hpp}
 

Classes

struct  treat_as_STL_Container< T >
 
struct  treat_as_LumieraIterator< T >
 
struct  can_direct_access_Last< T >
 

Functions

template<typename COL >
void __ensure_nonempty (COL const &coll)
 
template<typename COLL , typename = enable_if< treat_as_STL_Container<COLL>>>
auto first (COLL const &coll)
 access the first element of a STL-like container.
 
template<typename COLL , typename = enable_if< can_direct_access_Last<COLL>>>
auto last (COLL const &coll)
 access the last element of a STL-like container.
 
template<typename IT , typename = enable_if<treat_as_LumieraIterator<IT>>>
auto first (IT ii)
 extract the first element yielded by an Lumiera Forward Iterator.
 
template<class IT >
auto max (IT &&elms)
 
template<class CON >
auto max (CON const &elms)
 
template<class IT >
auto min (IT &&elms)
 
template<class CON >
auto min (CON const &elms)