STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
__gnu_parallel::__replace_selector< _It, _Tp > Struct Template Reference

std::replace() selector. More...

#include <parallel/for_each_selectors.h>

Inheritance diagram for __gnu_parallel::__replace_selector< _It, _Tp >:
__gnu_parallel::__generic_for_each_selector< _It >

Public Member Functions

 __replace_selector (const _Tp &__new_val)
 Constructor. More...
 
bool operator() (_Tp &__v, _It __i)
 Functor execution. More...
 

Public Attributes

const _Tp & __new_val
 Value to replace with. More...
 
- Public Attributes inherited from __gnu_parallel::__generic_for_each_selector< _It >
_It _M_finish_iterator
 _Iterator on last element processed; needed for some algorithms (e. g. std::transform()). More...
 

Detailed Description

template<typename _It, typename _Tp>
struct __gnu_parallel::__replace_selector< _It, _Tp >

std::replace() selector.

Constructor & Destructor Documentation

template<typename _It , typename _Tp >
__gnu_parallel::__replace_selector< _It, _Tp >::__replace_selector ( const _Tp &  __new_val)
inlineexplicit

Constructor.

Parameters
__new_valValue to replace with.
140 : __new_val(__new_val) {}
const _Tp & __new_val
Value to replace with.
Definition: for_each_selectors.h:135

Member Function Documentation

template<typename _It , typename _Tp >
bool __gnu_parallel::__replace_selector< _It, _Tp >::operator() ( _Tp &  __v,
_It  __i 
)
inline

Functor execution.

Parameters
__vCurrent value.
__iiterator referencing object.
147  {
148  if (*__i == __v)
149  *__i = __new_val;
150  return true;
151  }
const _Tp & __new_val
Value to replace with.
Definition: for_each_selectors.h:135

Member Data Documentation

template<typename _It , typename _Tp >
const _Tp& __gnu_parallel::__replace_selector< _It, _Tp >::__new_val

Value to replace with.


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