Wednesday, December 30, 2009

iterator_traits









Class Name iterator_traits

Header File <iterator>

Classification abstract data type



Class Relationship Diagram



Class Description

Member Classes



None



Types



Iterator::difference_type difference_type

Iterator::value_type value_type

Iterator::pointer pointer

Iterator::reference reference

Iterator::iterator_category iterator_category



Class Description



The iterator_traits template class describes the types associated with an iterator. They are described as type definitions. There is a iterator_traits defined for every iterator type. If there is to be a new iterator type to be defined and the d
efault type definitions are not adequate, a new iterator_traits<Iterator> is implicitly generated.






Iterator::difference_type difference_type



difference_type is of type Distance used to represent the difference between two iterators.





Iterator::value_type value_type



value_type is of type T, a class of objects that the iterator is pointing,





Iterator::pointer pointer



pointer has a default Pointer to type T.





Iterator::reference reference



reference has a default Reference to type T.






Iterator::iterator_category iterator_category



The iterator type defined by an iterator tag of the most specific iterator behavior. These are the five iterator tags which
represent the five types of iterators:





input_iterator_tag

output_iterator_tag

forward_iterator_tag

bidirectional_iterator_tag

random_access_iterator_tag





The Class Relationship Diagram for iterator_traits






No comments: