DGtal  1.4.2
DGtal::functors::Pair1stMutator< ReturnType > Class Template Reference

Aim: Define a simple unary functor that returns a reference on the first member of a pair in order to update it. More...

#include <DGtal/base/BasicFunctors.h>

Public Member Functions

template<typename TPair >
ReturnType & operator() (TPair &aPair) const
 
template<typename TPair >
const ReturnType & operator() (const TPair &aPair) const
 

Detailed Description

template<typename ReturnType>
class DGtal::functors::Pair1stMutator< ReturnType >

Aim: Define a simple unary functor that returns a reference on the first member of a pair in order to update it.

Description of template class 'Pair1stMutator'

Template Parameters
ReturnTypetype of the first member of the pair

Definition at line 815 of file BasicFunctors.h.

Member Function Documentation

◆ operator()() [1/2]

template<typename ReturnType >
template<typename TPair >
const ReturnType& DGtal::functors::Pair1stMutator< ReturnType >::operator() ( const TPair &  aPair) const
inline

Operator

Template Parameters
TPairmodel of CPair
Parameters
aPairinput pair
Returns
constant reference on the first member of aPair.

Definition at line 844 of file BasicFunctors.h.

845  {
846  return aPair.first;
847  }

◆ operator()() [2/2]

template<typename ReturnType >
template<typename TPair >
ReturnType& DGtal::functors::Pair1stMutator< ReturnType >::operator() ( TPair &  aPair) const
inline

Operator

Template Parameters
TPairmodel of CPair
Parameters
aPairinput pair
Returns
reference on the first member of aPair.

Definition at line 829 of file BasicFunctors.h.

830  {
831  return aPair.first;
832  }

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