__iterator_category man page on Solaris

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
Solaris logo
[printable version]

__iterator_category(3C++)	       -	     __iterator_category(3C++)

Standard C++ Library Copyright 1998, Rogue Wave Software, Inc.

NAME
       __iterator_category

	-  Determines the category to which an iterator belongs. This function
       is now obsolete. It is included for backward compatibility and to  sup‐
       port compilers that do not include partial specialization.

SYNOPSIS
       #include <iterator>
       template <class Category, class T, class Distance,
	 class Pointer, class Reference>
inline Category __iterator_category
  (const iterator<Category, T, Distance, Pointer,
  Reference>&);
template <;class T>
inline random_access_iterator_tag __iterator_category
  (const T*)

DESCRIPTION
       The___iterator_category	family	of  function  templates	 allows you to
       determine the category to which any iterator belongs. The  first	 func‐
       tion  takes an iterator of a specific type and returns the tag for that
       type. The last takes a T* and returns random_access_iterator_tag.

TAG TYPES
input_iterator_tag
output_iterator_tag
forward_iterator_tag
bidirectional_iterator_tag
random_access_iterator_tag

The __iterator_category function is  particularly  useful  for	improving  the
efficiency  of	algorithms.  An	 algorithm can use this function to select the
most efficient implementation an iterator is capable of handling without  sacrificing  the  ability	to  work  with	a  wide	 range	of iterator types. For
instance, both the advance and distance primitives use __iterator_category  to
maximize  their efficiency by using the tag returned from iterator_category to
select from one of several different auxiliary functions. Because  this	 is  a
compile	 time  selection,  use of this primitive incurs no significant runtime
overhead.

__iterator_category is typically used like this:

template <;class Iterator>
void foo(Iterator first, Iterator last)
{
 __foo(begin,end,__iterator_category(first));
}

template <;class Iterator>
void __foo(Iterator first, Iterator last,
	  input_iterator_tag>
{
  // Most general implementation
}

template <;class Iterator>
void __foo(Iterator first, Iterator last,
	  bidirectional_iterator_tag>
{
  // Implementation takes advantage of bi-directional
  // capability of the iterators
}

See the iterator section for a description of iterators and  the  capabilities
associated with each type of iterator tag.

SEE ALSO
       Other  iterator primitives:  __distance_type, distance, advance, itera‐
       tor

Rogue Wave Software		  02 Apr 1998	     __iterator_category(3C++)
[top]

List of man pages available for Solaris

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net