Muster
 All Classes Namespaces Files Functions Variables Typedefs Macros
counter_iterator< T > Struct Template Reference

Counting output iterator that records how many times an output iterator was assigned to, but ignores the value stored. More...

#include <counter.h>

Classes

struct  target
 struct representation of a no-op. Makes assignment to target do nothing. More...
 

Public Types

typedef T value_type
 
typedef T * pointer
 
typedef T & reference
 
typedef size_t difference_type
 
typedef std::output_iterator_tag iterator_category
 

Public Member Functions

 counter_iterator (value_type &c)
 
 counter_iterator (const counter_iterator &other)
 
counter_iteratoroperator= (const counter_iterator &other)
 
target operator* ()
 
counter_iteratoroperator++ ()
 
counter_iterator operator++ (int)
 

Public Attributes

pointer count
 

Detailed Description

template<class T>
struct cluster::counter_iterator< T >

Counting output iterator that records how many times an output iterator was assigned to, but ignores the value stored.

This is useful if you just want to know the size of something that an STL algorithm would output, without actually allocating space for it.

Note
Don't use this directly; Instantiate this using the counter() template function so that you don't have to supply a type (see sample usage in file docs).

Definition at line 58 of file counter.h.

Member Typedef Documentation

typedef size_t difference_type

Definition at line 62 of file counter.h.

typedef std::output_iterator_tag iterator_category

Definition at line 63 of file counter.h.

typedef T* pointer

Definition at line 60 of file counter.h.

typedef T& reference

Definition at line 61 of file counter.h.

typedef T value_type

Definition at line 59 of file counter.h.

Constructor & Destructor Documentation

counter_iterator ( value_type c)
inline

Definition at line 71 of file counter.h.

counter_iterator ( const counter_iterator< T > &  other)
inline

Definition at line 72 of file counter.h.

Member Function Documentation

target operator* ( )
inline

Definition at line 74 of file counter.h.

counter_iterator& operator++ ( )
inline

Definition at line 75 of file counter.h.

counter_iterator operator++ ( int  )
inline

Definition at line 76 of file counter.h.

counter_iterator& operator= ( const counter_iterator< T > &  other)
inline

Definition at line 73 of file counter.h.

Member Data Documentation

pointer count

Definition at line 70 of file counter.h.


The documentation for this struct was generated from the following file:
Muster. Copyright © 2010, Lawrence Livermore National Laboratory, LLNL-CODE-433662.
Distribution of Muster and its documentation is subject to terms of the Muster LICENSE.
Generated on Thu Sep 1 2016 using Doxygen 1.8.5