Thursday, February 4, 2010

front_insert_iterator









Class Name front_insert_iterator

Header File <iterator>

Classification abstract data type



Class Relationship Diagram



Class Description

Member Classes


Container& container

Methods



explicit front_insert_iterator(Container& x);


Operators




front_insert_iterator<Container>& operator=
(const typename Container::value_type value);

front_insert_iterator<Container>& operator*();

front_insert_iterator<Container>& operator++();

front_insert_iterator<Container>& operator++(int);







Class Description



The front_insert_iterator inserts elements at the front of a container by
using the container's push_front() method to perform the insertion.




Container& container



The container in which elements will be inserted.








Method front_insert_iterator()

Access Public

Classification Constructor

Syntax explicit front_insert_iterator(Container& x);

Paramters x is the reference to the container in which elements
will be inserted.

Returns None




Description



The constructor constructs a front_insert_iterator object and initializes
Container& container with a x.








Method operator*()

Access Public

Classification Accessor

Syntax front_insert_iterator<Container>& operator*();

Parameters None

Returns This operator returns a pointer to the invoking object.



Description



The dereference operator returns *this.








Method operator++()

Access Public

Classification Accessor

Syntax front_insert_iterator<Container>& operator++();

Parameters None

Returns This operator returns a pointer to the invoking object.




Description



This incrementation operator returns *this.








Method operator++()

Access Public

Classification Accessor

Syntax front_insert_iterator<Container> operator++(int x);

Parameters x has no bearing on this function.

Returns This operator returns a pointer to the invoking object.



Description



This incrementation operator returns *this.








Method operator=()

Access Public

Classification Modifier

Syntax front_insert_iterator<Container>&
operator=(const typename Container::value_type& value);

Parameters value is the reference to the type value_type that
is inserted into the container.

Returns This operator returns a pointer to the invoking object.



Description



The assignment operator is converted to an insertion operation using
container.push_front(value). The operator returns *this.






The Class Relationship Diagram for front_insert_iterator





No comments: