FougTools  0.7.0dev-046fb6a
Handy tools for C++, Qt and OpenCascade
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
cpp::push_iterator< CONTAINER > Class Template Reference

#include <pusher.h>

Inheritance diagram for cpp::push_iterator< CONTAINER >:

Public Types

typedef CONTAINER CONTAINER_type
 

Public Member Functions

 push_iterator (CONTAINER &x)
 
push_iterator< CONTAINER > & operator= (const typename CONTAINER::value_type &value)
 
push_iterator< CONTAINER > & operator= (typename CONTAINER::value_type &&value)
 
push_iterator< CONTAINER > & operator* ()
 
push_iterator< CONTAINER > & operator++ ()
 
push_iterator< CONTAINER > operator++ (int)
 

Protected Attributes

CONTAINER * m_container
 

Detailed Description

template<typename CONTAINER>
class cpp::push_iterator< CONTAINER >

Push iterator

A push_iterator is a special type of output iterator designed to allow algorithms that usually overwrite elements (such as copy) to instead push new elements automatically into the container.

The container needs to have a push() member function (such as the standard containers queue and stack).

Using the assignment operator on the returned iterator (either dereferenced or not), causes the container to expand by one element, which is initialized to the value assigned.

The returned iterator supports all other typical operations of output iterators but have no effect: all values assigned are pushed into the container.

Member Typedef Documentation

template<typename CONTAINER >
typedef CONTAINER cpp::push_iterator< CONTAINER >::CONTAINER_type

Constructor & Destructor Documentation

template<typename CONTAINER >
cpp::push_iterator< CONTAINER >::push_iterator ( CONTAINER &  x)
inlineexplicit

Member Function Documentation

template<typename CONTAINER >
push_iterator<CONTAINER>& cpp::push_iterator< CONTAINER >::operator* ( )
inline
template<typename CONTAINER >
push_iterator<CONTAINER>& cpp::push_iterator< CONTAINER >::operator++ ( )
inline
template<typename CONTAINER >
push_iterator<CONTAINER> cpp::push_iterator< CONTAINER >::operator++ ( int  )
inline
template<typename CONTAINER >
push_iterator<CONTAINER>& cpp::push_iterator< CONTAINER >::operator= ( const typename CONTAINER::value_type &  value)
inline
template<typename CONTAINER >
push_iterator<CONTAINER>& cpp::push_iterator< CONTAINER >::operator= ( typename CONTAINER::value_type &&  value)
inline

Member Data Documentation

template<typename CONTAINER >
CONTAINER* cpp::push_iterator< CONTAINER >::m_container
protected

The documentation for this class was generated from the following file: