cxxtls::foreach_helpers Namespace Reference

Classes

struct  AnyType
struct  AnyTypeBase
struct  EvalTypeIf
 Define a member typedef that is either ZeroClass or OneClass based on the value of the bool. Note that effect is accomplished using specialization, not here in this base class. see below. More...
struct  EvalTypeIf< 0, ZeroClass, OneClass >
struct  EvalTypeIf< 1, ZeroClass, OneClass >
struct  IteratorReferent
 Given a container as a template parameter, determine the return data type of its "iterator" -- particularly the constness thereof. Define a nested member typedef, type, which maps to the return value type of. More...
struct  IteratorReferent< const Container[N]>
struct  IteratorReferent< Container[N]>
struct  iteratorReturnsConst
 Define a nested constant, value, which is true if the specified Container type has an iterator which returns a const version of Container::value_type. Set for example has no non-const iterator. If std::set is the Container passed in then the value will be true. It will be false for most normal containers. More...
struct  IteratorWrapper
struct  IteratorWrapper< T * >
 A wrapper around a pointer, which is an iterator to a normal C++ array. More...

Typedefs

typedef unsigned long long size_t

Functions

template<class T , size_t N>
bool continuing (AnyTypeBase const &current, AnyTypeBase const &last, T const (*)[N])
 Given foreach loop variables, "current" and "last", return true if current is not equal to last.
template<class Container >
bool continuing (AnyTypeBase const &current, AnyTypeBase const &last, Container const *)
 Given foreach loop variables, "current" and "last", return true if current is not equal to last.
template<class T , size_t N>
T & deref (AnyTypeBase const &current, T(*)[N])
 Given a reference to an iterator into the specified mutable C++ container, return a reference to the object it refers to.
template<class T , size_t N>
T const & deref (AnyTypeBase const &current, T const (*)[N])
 Given a reference to an iterator into the specified const C++ array, return a reference to the object it refers to.
template<class Container >
const Container::value_type & deref (AnyTypeBase const &current, Container const *)
 Given a reference to an iterator into the specified "const" container, return a reference to the object it refers to.
template<class Container >
IteratorReferent< Container >
::type & 
deref (AnyTypeBase const &current, Container *)
 Given a reference to an iterator into the specified container, return a reference to the object it refers to.
template<class T , size_t N>
AnyType< IteratorWrapper< T * > > getBegin (AnyTypeBase const &b, T const (*)[N])
 Given a reference to a C++ array, return an AnyType<> object that is a wrapper for a pointer to the first object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.
template<class T >
AnyType< IteratorWrapper< T > > getBegin (AnyTypeBase const &b, T const *)
 Given a reference to an STL container, return an AnyType<> object that is a wrapper for an iterator to the first object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.
template<class T , size_t N>
AnyType< T const * > getContainer (T const (&v)[N])
 Given a reference to a C++ array, return an AnyType<> object that is a reference to said container.
template<class T >
AnyType< T & > getContainer (T const &v)
 Given a reference to an STL container, return an AnyType<> object that is a reference to said container.
template<class T , size_t N>
AnyType< IteratorWrapper< T * > > getEnd (AnyTypeBase const &b, T const (*)[N])
 Given a reference to a C++ array, return an AnyType<> object that is a wrapper for an iterator to the "end" object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.
template<class T >
AnyType< IteratorWrapper< T > > getEnd (AnyTypeBase const &b, T const *)
 Given a reference to an STL container, return an AnyType<> object that is a wrapper for an iterator to the "end" object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.
template<class T , size_t N>
bool next (AnyTypeBase const &current, AnyTypeBase const &last, T const (*)[N])
 Given foreach loop variables, "current" and "last", if current is not equal to last, increment it.
template<class Container >
bool next (AnyTypeBase const &current, AnyTypeBase const &last, Container const *)
 Given foreach loop variables, "current" and "last", if current is not equal to last, increment it.

Typedef Documentation

typedef unsigned long long size_t

Definition at line 9 of file foreach.h.


Function Documentation

bool cxxtls::foreach_helpers::continuing ( AnyTypeBase const &  current,
AnyTypeBase const &  last,
T const   (*)[N] 
)

Given foreach loop variables, "current" and "last", return true if current is not equal to last.

Definition at line 388 of file foreach.h.

bool cxxtls::foreach_helpers::continuing ( AnyTypeBase const &  current,
AnyTypeBase const &  last,
Container const *   
)

Given foreach loop variables, "current" and "last", return true if current is not equal to last.

Definition at line 370 of file foreach.h.

T& cxxtls::foreach_helpers::deref ( AnyTypeBase const &  current,
T(*)  [N] 
)

Given a reference to an iterator into the specified mutable C++ container, return a reference to the object it refers to.

Definition at line 349 of file foreach.h.

T const& cxxtls::foreach_helpers::deref ( AnyTypeBase const &  current,
T const   (*)[N] 
)

Given a reference to an iterator into the specified const C++ array, return a reference to the object it refers to.

Definition at line 330 of file foreach.h.

const Container::value_type& cxxtls::foreach_helpers::deref ( AnyTypeBase const &  current,
Container const *   
)

Given a reference to an iterator into the specified "const" container, return a reference to the object it refers to.

Definition at line 310 of file foreach.h.

IteratorReferent<Container>::type& cxxtls::foreach_helpers::deref ( AnyTypeBase const &  current,
Container *   
)

Given a reference to an iterator into the specified container, return a reference to the object it refers to.

Definition at line 290 of file foreach.h.

AnyType< IteratorWrapper<T*> > cxxtls::foreach_helpers::getBegin ( AnyTypeBase const &  b,
T const   (*)[N] 
)

Given a reference to a C++ array, return an AnyType<> object that is a wrapper for a pointer to the first object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.

Definition at line 231 of file foreach.h.

AnyType< IteratorWrapper<T> > cxxtls::foreach_helpers::getBegin ( AnyTypeBase const &  b,
T const *   
)

Given a reference to an STL container, return an AnyType<> object that is a wrapper for an iterator to the first object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.

Definition at line 212 of file foreach.h.

AnyType< T const* > cxxtls::foreach_helpers::getContainer ( T const (&)  v[N]  ) 

Given a reference to a C++ array, return an AnyType<> object that is a reference to said container.

Definition at line 197 of file foreach.h.

AnyType< T & > cxxtls::foreach_helpers::getContainer ( T const &  v  ) 

Given a reference to an STL container, return an AnyType<> object that is a reference to said container.

Definition at line 185 of file foreach.h.

AnyType< IteratorWrapper<T*> > cxxtls::foreach_helpers::getEnd ( AnyTypeBase const &  b,
T const   (*)[N] 
)

Given a reference to a C++ array, return an AnyType<> object that is a wrapper for an iterator to the "end" object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.

Definition at line 269 of file foreach.h.

AnyType< IteratorWrapper<T> > cxxtls::foreach_helpers::getEnd ( AnyTypeBase const &  b,
T const *   
)

Given a reference to an STL container, return an AnyType<> object that is a wrapper for an iterator to the "end" object in the container. The wrapper's sole purpose is to make the contents accessible as an AnyType object.

Definition at line 252 of file foreach.h.

bool cxxtls::foreach_helpers::next ( AnyTypeBase const &  current,
AnyTypeBase const &  last,
T const   (*)[N] 
)

Given foreach loop variables, "current" and "last", if current is not equal to last, increment it.

throw and exception if current == last.

Definition at line 435 of file foreach.h.

bool cxxtls::foreach_helpers::next ( AnyTypeBase const &  current,
AnyTypeBase const &  last,
Container const *   
)

Given foreach loop variables, "current" and "last", if current is not equal to last, increment it.

throw and exception if current == last.

Definition at line 406 of file foreach.h.

Here is the caller graph for this function:

Generated on Wed Feb 29 22:58:54 2012 for CXXUtilities by  doxygen 1.6.3