__GNU_PARALLEL::__REPLACE_IF_SELECTOR(3)

πŸ“¦
version 16.2.1+r23+gd564253eb6c8 Β· 6 versions
, in arch rolling, fedora 44

πŸ’– __gnu_parallel::__replace_if_selector< _It, _Op, _Tp > πŸ’–

okay bestie, so this is a page from the Library Functions Manual, and it's all about one lil struct in libstdc++ that does the std::replace() thing but in parallel. it's a selector, which is basically the little helper that goes "you take this chunk, I'll take that chunk" when the parallel algorithms are dividing up work. it's giving backstage crew energy, honestly. πŸŽ€


✨ NAME ✨

__gnu_parallel::__replace_if_selector< _It, _Op, _Tp > β€” the std::replace() selector. no cap, that's the whole job description.


✨ SYNOPSIS ✨

#include <for_each_selectors.h>

it Inherits from __gnu_parallel::__generic_for_each_selector< _It >, so it's lowkey part of the for-each-selector family tree. πŸ¦‹

🌸 Public Member Functions 🌸

  • __replace_if_selector (const _Tp &__new_val) β€” the Constructor, babes.
  • bool operator() (_Op &__o, _It __i) β€” the Functor execution. this is where the magic actually happens.

🌸 Public Attributes 🌸

  • const _Tp & __new_val β€” the Value to replace with. iconic.
  • _It _M_finish_iterator β€” _Iterator on last element processed; needed for some algorithms (e. g. std::transform()). she's the bookmark, periodt.

✨ Detailed Description ✨

template<typename _It, typename _Op, typename _Tp>
struct __gnu_parallel::__replace_if_selector< _It, _Op, _Tp >

that's it. that's the struct. it's the "std::replace() selector." fr fr, it says so right there.


✨ Constructor & Destructor Documentation ✨

template<typename _It, typename _Op, typename _Tp>
__gnu_parallel::__replace_if_selector< _It, _Op, _Tp >::__replace_if_selector (const _Tp & __new_val) [inline],  [explicit]

it's the Constructor. nothing mysterious, she just shows up and gets built. also note the [inline] and [explicit] β€” yes bestie, she is explicit, no accidental conversions around here πŸ’…

Parameters

  • __new_val β€” Value to replace with.

References __new_val.


✨ Member Function Documentation ✨

template<typename _It, typename _Op, typename _Tp> bool
__gnu_parallel::__replace_if_selector< _It, _Op, _Tp >::operator() (_Op & __o, _It __i) [inline]

this is the Functor execution. the actual moment where she does the thing. also [inline], obviously, she's efficient like that. ✨

Parameters

  • __o β€” Operator.
  • __i β€” iterator referencing object.

References __new_val.


✨ Member Data Documentation ✨

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

Value to replace with. short and sweet, that's her whole personality.

Referenced by __replace_if_selector(), and operator()().


template<typename _It> _It __gnu_parallel::__generic_for_each_selector< _It
>::_M_finish_iterator [inherited]

_Iterator on last element processed; needed for some algorithms (e. g. std::transform()). note the [inherited] tag β€” she didn't come from this struct, she came from __generic_for_each_selector< _It >, so be nice to her. πŸ’œ

fr fr, _M_finish_iterator is inherited, not her own. don't @ me.

✨ Author ✨

Generated automatically by Doxygen for libstdc++ from the source code. so like… nobody hand-wrote this, a robot did it, and honestly? the robot ate. πŸ‘‘


and that's the whole page, bestie! πŸ’– this little doc came from libstdc++ and the header up top just calls it __gnu_para..._Op, _Tp >(3) because even manpage headers run out of room sometimes 😭. mwah, go write some parallel replace code. 🫢✨🌸

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms