Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Standard C++ Library Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

__distance_type()


Does not inherit

Local Index

No Entries

Summary

A function that determines the type of distance used by an iterator.


NOTE -- This function is now obsolete. It is retained here to
support compilers that do not include partial specialization, but
will be dropped in a subsequent release.

Synopsis

Description

The __distance_type() family of function templates returns a pointer to a value that is of the same type as that used to represent a distance between two iterators. The first of these takes an iterator of a particular type and returns a pointer to a default value of the difference_type for that iterator. The T* form of the function returns ptrdiff_t*.

Generic algorithms use this function to create local variables of the correct type. The __distance_type() functions are typically used like this:

The auxiliary function template allows the algorithm to extract a distance type from the first iterator and then use that type to perform some useful work.

See Also

Other iterator primitives: __iterator_category(), distance(), advance()



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.