DGtal  0.9.3beta
Static Public Member Functions
DGtal::OpInSTLContainers< Container, Iterator > Struct Template Reference

#include <DGtal/base/OpInSTLContainers.h>

Static Public Member Functions

static Iterator erase (Container &aContainer, Iterator &anIterator)
 
static Iterator insert (Container &aContainer, Iterator &anIterator)
 

Detailed Description

template<typename Container, typename Iterator>
struct DGtal::OpInSTLContainers< Container, Iterator >

Aim: Implementation of an adapter for erase and insert methods of STL containers so that they not only work for the iterator type, but also for the reverse_iterator type.

Description of struct 'OpInSTLContainers'

// anIterator = aContainer.erase(anIterator);
//does not compile if anIterator has type 'std::reverse_iterator'
//erase only takes parameter of type 'std::iterator'
anIterator =
::erase(aContainer, anIterator);
See also
Preimage2D.ih

Definition at line 76 of file OpInSTLContainers.h.

Member Function Documentation

template<typename Container , typename Iterator >
static Iterator DGtal::OpInSTLContainers< Container, Iterator >::erase ( Container &  aContainer,
Iterator &  anIterator 
)
inlinestatic

Definition at line 78 of file OpInSTLContainers.h.

79  {
80  return aContainer.erase(anIterator);
81  }
template<typename Container , typename Iterator >
static Iterator DGtal::OpInSTLContainers< Container, Iterator >::insert ( Container &  aContainer,
Iterator &  anIterator 
)
inlinestatic

Definition at line 83 of file OpInSTLContainers.h.

84  {
85  return aContainer.insert(anIterator);
86  }

The documentation for this struct was generated from the following file: