__GNU_PARALLEL::__REPLACE_SELECTOR(3)

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

✨ NAME ✨

__gnu_parallel::__replace_selector< _It, _Tp > β€” the std::replace() selector, bestie πŸ’–

okay so real quick, this is a page from the Library Functions Manual, section 3, and it's all about one lil struct that lives in the GNU parallel universe. it does exactly one job and it does it gorgeously.


🌸 SYNOPSIS 🌸

#include <for_each_selectors.h>

it inherits from __gnu_parallel::__generic_for_each_selector< _It > β€” so all that base-class energy is coming along for the ride, no cap. 🧬

πŸŽ€ Public Member Functions

  • __replace_selector (const _Tp &__new_val) β€” the Constructor. builds the thing, sets the vibe.
  • bool operator() (_Tp &__v, _It __i) β€” Functor execution. this is the part that actually goes πŸƒβ€β™€οΈ

πŸŽ€ Public Attributes

  • const _Tp & __new_val β€” Value to replace with. the glow-up target, literally.
  • _It _M_finish_iterator β€” _Iterator on last element processed; needed for some algorithms (e. g. std::transform()). she's the lil bookmark that keeps track of where we ended up πŸ¦‹

πŸ¦‹ Detailed Description πŸ¦‹

template<typename _It, typename _Tp>
    struct __gnu_parallel::__replace_selector< _It, _Tp >"std::replace()
    selector.
yes that stray little " is literally in there, i am not playing, i am not editorializing, i am just the messenger πŸ™ˆ

so like, the whole point: it's a selector for std::replace(). template over _It (your iterator type) and _Tp (your value type), and it slots into the parallel machinery so replacing stuff can happen across your whole range. periodt. πŸ’…


πŸ’… Constructor & Destructor Documentation πŸ’…

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

Constructor. she's [inline] AND [explicit] β€” no sneaky implicit conversions around here, we have standards ✨

Parameters

  • __new_val β€” Value to replace with.

References __new_val.


πŸ”₯ Member Function Documentation πŸ”₯

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

Functor execution. this is where the magic happens, bestie β€” you hand her a value and an iterator and she does the thing. πŸͺ„

Parameters

  • __v β€” Current value.
  • __i β€” iterator referencing object.

References __new_val.


πŸ‘‘ Member Data Documentation πŸ‘‘

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

Value to replace with. that's it, that's the data. simple, iconic, effective. πŸ“

Referenced by __replace_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 β€” this one's not hers originally, she got it from __generic_for_each_selector< _It >. sharing is caring. 🫢


⭐ Author ⭐

Generated automatically by Doxygen for libstdc++ from the source code.


πŸ’€ a gentle PSA from me to you: this page is Doxygen-generated, so the prose is giving "robot wrote it at 3am". i have simply fixed the aura. the facts? untouched. every template param, every bracket, every [inline], every [inherited] β€” all still exactly where they were. πŸ”₯

okay bye bestie, go replace some values πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

libstdc++ Β· __gnu_para..._It, _Tp >(3) Β· Library Functions Manual Β· section 3 β€” no date on the tin, so we're calling it timeless, which honestly? ate. πŸ‘‘

πŸ“¦ 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