lean cpp library
A lean C++ library providing efficient utility classes for high-performance C++ applications.
Classes | Functions
lean::functional Namespace Reference

Defines helper templates that may be useful in a functional programming context. More...

Classes

class  callable_fun
 Stores the pointer to a function to be called on invokation of operator (). More...
class  callable_memfun
 Stores an object and a pointer to a method to be called on invokation of operator (). More...
struct  hash
 Computes hash values from elements of the given type. More...

Functions

template<class Iterator1 , class Iterator2 >
bool equal (Iterator1 begin1, Iterator1 end1, Iterator2 begin2, Iterator2 end2)
 Compares the elements in the given ranges.
template<class Iterator1 , class Iterator2 , class Pred >
bool equal (Iterator1 begin1, Iterator1 end1, Iterator2 begin2, Iterator2 end2, Pred pred)
 Compares the elements in the given ranges using the given predicate.
template<class Range1 , class Range2 >
bool equal (const Range1 &range1, const Range2 &range2)
 Compares the elements in the given ranges.
template<class Range1 , class Range2 , class Pred >
bool equal (const Range1 &range1, const Range2 &range2, Pred pred)
 Compares the elements in the given ranges using the given predicate.
template<class Range1 , class Range2 >
bool lexicographical_compare (const Range1 &range1, const Range2 &range2)
 Compares the elements in the given ranges.
template<class Range1 , class Range2 , class Pred >
bool lexicographical_compare (const Range1 &range1, const Range2 &range2, Pred pred)
 Compares the elements in the given ranges using the given predicate.
template<class Iterator >
Iterator insert_last (Iterator first, Iterator last)
 Inserts the element pointed at by last into the given sorted range [first, last).
template<class Iterator , class Predicate >
Iterator insert_last (Iterator first, Iterator last, Predicate predicate)
 Inserts the element pointed at by last into the given sorted range [first, last).
template<class Vector , class Value >
Vector::iterator push_sorted (Vector &vector, const Value &value)
 Pushes the given element into the given sorted vector.
template<class Vector , class Value , class Predicate >
Vector::iterator push_sorted (Vector &vector, const Value &value, Predicate predicate)
 Pushes the given element into the given sorted vector.
template<class Iterator , class Value >
Iterator find_sorted (Iterator begin, Iterator end, const Value &value)
 Locates the position of the first occurence of the given element in the given sorted range.
template<class Iterator , class Value , class Ord , class Eq >
Iterator find_sorted (Iterator begin, Iterator end, const Value &value, Ord order, Eq equal)
 Locates the position of the first occurence of the given element in the given sorted range.
template<class Vector , class Value >
bool remove (Vector &vector, const Value &value)
 Removes the given element from the given vector.
template<class Vector , class Value >
bool remove_ordered (Vector &vector, const Value &value)
 Removes the given element from the given vector.
template<class Signature >
LEAN_INLINE callable_fun
< Signature > 
make_callable (Signature *fun)
 Constructs a callable object from the given function pointer.
template<class Class , class Signature >
LEAN_INLINE callable_memfun
< Class, Signature > 
make_callable (Class *obj, Signature Class::*fun)
 Constructs a callable object from the given object and method pointer.

Detailed Description

Defines helper templates that may be useful in a functional programming context.