STD::MASK_ARRAY(3)

πŸ’– std::mask_array<_Tp> πŸ’–

okay bestie, welcome to std::mask_array< _Tp > from the Library Functions Manual, section 3 πŸŽ€ β€” it's a Reference to selected subset of an array. no cap, that's literally the whole vibe.


✨ NAME ✨

std::mask_array< _Tp > β€” a reference to a selected subset of an array, and she ate πŸ’…


🌸 SYNOPSIS 🌸

#include <valarray>

πŸ¦‹ Public Types

  • typedef _Tp value_type

🫢 Public Member Functions

  • mask_array (const mask_array &) β€” the copy constructor. Both slices refer to the same underlying array. (yes, they're sharing, it's giving twins not clones 😭)
  • template<class _Dom> void operator%= (const _Expr< _Dom, _Tp > &) const
  • void operator%= (const valarray< _Tp > &) const β€” Modulo slice elements by corresponding elements of v.
  • template<class _Dom> void operator&= (const _Expr< _Dom, _Tp > &) const
  • void operator&= (const valarray< _Tp > &) const β€” Logical and slice elements with corresponding elements of v.
  • template<class _Dom> void operator*= (const _Expr< _Dom, _Tp > &) const
  • void operator*= (const valarray< _Tp > &) const β€” Multiply slice elements by corresponding elements of v.
  • template<class _Dom> void operator+= (const _Expr< _Dom, _Tp > &) const
  • void operator+= (const valarray< _Tp > &) const β€” Add corresponding elements of v to slice elements.
  • template<class _Dom> void operator-= (const _Expr< _Dom, _Tp > &) const
  • void operator-= (const valarray< _Tp > &) const β€” Subtract corresponding elements of v from slice elements.
  • template<class _Dom> void operator/= (const _Expr< _Dom, _Tp > &) const
  • void operator/= (const valarray< _Tp > &) const β€” Divide slice elements by corresponding elements of v.
  • template<class _Dom> void operator<<= (const _Expr< _Dom, _Tp > &) const
  • void operator<<= (const valarray< _Tp > &) const β€” Left shift slice elements by corresponding elements of v.
  • template<class _Dom> void operator= (const _Expr< _Dom, _Tp > &) const
  • template<class _Ex> void operator= (const _Expr< _Ex, _Tp > &__e) const
  • void operator= (const _Tp &) const β€” Assign all slice elements to t.
  • mask_array & operator= (const mask_array &) β€” the assignment operator. Assigns elements to corresponding elements of a.
  • void operator= (const valarray< _Tp > &) const
  • template<class _Dom> void operator>>= (const _Expr< _Dom, _Tp > &) const
  • void operator>>= (const valarray< _Tp > &) const β€” Right shift slice elements by corresponding elements of v.
  • template<class _Dom> void operator^= (const _Expr< _Dom, _Tp > &) const
  • void operator^= (const valarray< _Tp > &) const β€” Logical xor slice elements with corresponding elements of v.
  • template<class _Dom> void operator|= (const _Expr< _Dom, _Tp > &) const
  • void operator|= (const valarray< _Tp > &) const β€” Logical or slice elements with corresponding elements of v.

πŸ‘‘

Friends

  • class valarray< _Tp >

πŸ’œ DETAILED DESCRIPTION πŸ’œ

template<class _Tp>
class std::mask_array< _Tp >

"Reference to selected subset of an array." periodt.

so a mask_array is a reference to the actual elements of an array, and those elements get picked out by a bitmask β€” which shows up in the form of an array of bool. the way you get a mask_array is to call operator[](valarray<bool>) on a valarray. the mask_array that comes back then lets you carry operations out on that referenced subset of elements in the original valarray. it's giving backstage pass to some of the array, not the whole thing πŸ”₯

for example, if a mask_array is obtained using the array (false, true, false, true) as an argument, the mask array has two elements referring to array[1] and array[3] in the underlying array. see how she skipped index 0 and 2? iconic filtering behaviour ✨

πŸ“ Parameters

  • Tp β€” Element type.

🧚 MEMBER FUNCTION DOCUMENTATION 🧚

okay so here are the valarray versions spelled out in full, one by one, no skipping, we do not leave the girlies behind πŸ’…

  • template<class _Tp> void std::mask_array< _Tp >::operator%= (const valarray< _Tp > & ) const β€” Modulo slice elements by corresponding elements of v.
  • template<class _Tp> void std::mask_array< _Tp >::operator&= (const valarray< _Tp > & ) const β€” Logical and slice elements with corresponding elements of v.
  • template<class _Tp> void std::mask_array< _Tp >::operator*= (const valarray< _Tp > & ) const β€” Multiply slice elements by corresponding elements of v.
  • template<class _Tp> void std::mask_array< _Tp >::operator+= (const valarray< _Tp > & ) const β€” Add corresponding elements of v to slice elements.
  • template<class _Tp> void std::mask_array< _Tp >::operator-= (const valarray< _Tp > & ) const β€” Subtract corresponding elements of v from slice elements.
  • template<class _Tp> void std::mask_array< _Tp >::operator/= (const valarray< _Tp > & ) const β€” Divide slice elements by corresponding elements of v.
  • template<class _Tp> void std::mask_array< _Tp >::operator<<= (const valarray< _Tp > & ) const β€” Left shift slice elements by corresponding elements of v.
  • template<class _Tp> void std::mask_array< _Tp >::operator>>= (const valarray< _Tp > & ) const β€” Right shift slice elements by corresponding elements of v.
  • template<class _Tp> void std::mask_array< _Tp >::operator^= (const valarray< _Tp > & ) const β€” Logical xor slice elements with corresponding elements of v.
  • template<class _Tp> void std::mask_array< _Tp >::operator|= (const valarray< _Tp > & ) const β€” Logical or slice elements with corresponding elements of v.

🌈 AUTHOR 🌈

Generated automatically by Doxygen for libstdc++ from the source code. (the robot wrote it, I just did her makeup πŸ’–)


and that's the whole page bestie, no notes, we kept every single operator, every overload, every default, every word β€” slay πŸ’…βœ¨

kisses, this was std::mask_array< _Tp >(3) from libstdc++, section 3 of the manual, and it's literally the end of the page πŸŽ€πŸ¦‹πŸ’œ

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