C++ Extensions (cppx) Documentation Internal Version
Main | Namespaces | Classes | NamespaceMembers | ClassMembers | Files

stdxIseq.h Classes and Functions

This is a collection of classes and functions which implement the concept of explicit input sequences. Overloaded functions are provided for various STL functions in <algorithm>. The objective is to avoid the tedious requirement to specify two iterators whenever using any of the sequence algorithms. It would be much easier to just specify the container itself, and this would imply iterating over the entire container. The idea comes from Stroustrup's "The C++ Programming Language: 3rd Edition" Section 18.3.1.

Compounds

Functions

Input Sequence Writers
Algorithms Overloaded for Iseqs
Iseq Helper Functions

Detailed Documentation

Function Documentation

template<class In>
void iseqWriter stdx::Iseq< In >    in,
std::ostream &    os,
const std::string &    delimiter = DEFAULT_SEQ_DELIM
 

A function which takes an input sequence and outputs each element in the sequence. The delimiter is appended after each element excluding the final element. An example is below:

 list<int> testList(5);
 testList[0] = 1;
 testList[1] = 2;
 testList[2] = 3;
 testList[3] = 4;
 testList[4] = 5;
 iseqWriter(stdx::iseq(testList),cout,", ");

Will result in the following output:

 1, 2, 3, 4, 5
 

template<class In>
std::ostream& operator<< std::ostream &    os,
const stdx::Iseq< In > &    inseq
 

The actual insertion operator for input sequences.

template<class In, class Fun>
Fun for_each Iseq< In >    r,
Fun    f
 

template<class In>
Iseq< typename C::iterator > iseq C &    c [related, inherited]
 

A function which creates an input sequence for the entire container given as a container. This helps simplify code which iterates over an entire container. For example we can now iterate over an entire list two ways:

 for_each( lst.begin(), lst.end(), dosomething() );
 for_each( iseq(lst), dosomething() );

template<class In>
Iseq< typename C::const_iterator > ciseq const C &    c [related, inherited]
 

Similar to stdx::iseq() except that this produces an input sequence with two constant iterators.

template<class In>
std::string iseqWriter stdx::Iseq< In >    in,
const std::string &    delimiter = DEFAULT_SEQ_DELIM
 

Overloaded version of stdx::sequenceFormatter which returns a string and thus makes it more convenient to directly insert a sequence into a stream.

template<class In, class T>
In find Iseq< In >    r,
const T &    v
 

template<class In, class Pred>
In find_if Iseq< In >    r,
Pred    p
 

template<class In, class T>
In remove Iseq< In >    r,
const T &    v
 

template<class In, class Pred>
In remove_if Iseq< In >    r,
Pred    p
 

template<class In, class Out>
Out copy Iseq< In >    r,
Out    res
 

template<class In, class Out, class Pred>
Out copy_if Iseq< In >    r,
Out    res,
Pred    p
 

template<class In, class Out>
Out copy_ptr Iseq< In >    r,
Out    res
 

template<class In, class Out, class Pred>
Out copy_ptr_if Iseq< In >    r,
Out    res,
Pred    p
 

template<class Ran, class Cmp>
void sort Iseq< Ran >    r,
Cmp    cmp
 

template<class Ran>
void sort Iseq< Ran >    r
 

template<class Ran, class Cmp>
void stable_sort Iseq< Ran >    r,
Cmp    cmp
 

template<class In1, class In2, class BinOp>
BinOp for_each Iseq< In1 >    in1,
In2    in2,
BinOp    op
 

template<class In, class Out, class Op>
Out transform Iseq< In >    r,
Out    res,
Op    op
 

template<class In, class In2, class Out, class BinOp>
Out transform Iseq< In >    r,
In2    in2,
Out    res,
BinOp    op
 

template<class In>
In min_element Iseq< In >    r
 

template<class For, class Cmp>
For unique Iseq< For >    r,
Cmp    cmp
 

template<class For>
For unique Iseq< For >    r
 

template<class For, class Out, class Cmp>
Out unique_copy Iseq< For >    r,
Out    o,
Cmp    cmp
 

template<class For, class Out>
Out unique_copy Iseq< For >    r,
Out    o
 

template<class For, class Out>
bool equal Iseq< For >    r,
Out    o
 

template<class For, class Gen>
void generate Iseq< For >    in,
Gen    g
 

template<class For, class T>
void fill Iseq< For >    in,
const T &    val
 

template<class For>
void rotate_left Iseq< For >    in
 

template<class For>
For max_element Iseq< For >    in
 

template<class In, class Pred>
std::iterator_traits<In>::difference_type count_if Iseq< In >    in,
Pred    p
 

template<class In, class Val>
std::iterator_traits<In>::difference_type count Iseq< In >    in,
Val    v
 

Generated on Mon Aug 15 21:43:09 2005 by Doxygen 1.2.13-20020210 written by Dimitri van Heesch © 1997-2002