Rogue Wave banner
Previous fileTop of documentContentsIndexNext file

__distance_type


Iterator primitive

Summary

Determines the type of distance used by an iterator. This function is now obsolete. It is retained in order to include backward compatibility and support compilers that do not include partial specialization.

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

None

Synopsis

Description

The __distance_type family of function templates return 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 take an iterator of a particular type and return 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: __value_type, __iterator_category, distance, advance



Previous fileTop of documentContentsIndexNext file
Copyright (c) 1998, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.
OEM Release, June 1998