Standard C++ Library Class Reference
used to instantiate the iterator. The fifth version takes and returns a T* in order to handle the case
when an iterator is a simple pointer.
This family of function templates can be used to extract a value type from an iterator and
subsequently use that type to create a local variable. Typically the value_type functions are used
like this:
template <class Iterator>
void foo(Iterator first, Iterator last)
{
__foo(begin,end,value_type(first));
}
template <class Iterator, class T>
void __foo(Iterator first, Iterator last, T*>
{
T temp = *first;
_
}
The auxiliary function __foo extracts a usable value type from the iterator and then puts the type
to work.
See Also
Other iterator primitives: distance_type, iterator_category, distance, advance