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 > &) constvoid operator%= (const valarray< _Tp > &) constβ Modulo slice elements by corresponding elements of v.template<class _Dom> void operator&= (const _Expr< _Dom, _Tp > &) constvoid operator&= (const valarray< _Tp > &) constβ Logical and slice elements with corresponding elements of v.template<class _Dom> void operator*= (const _Expr< _Dom, _Tp > &) constvoid operator*= (const valarray< _Tp > &) constβ Multiply slice elements by corresponding elements of v.template<class _Dom> void operator+= (const _Expr< _Dom, _Tp > &) constvoid operator+= (const valarray< _Tp > &) constβ Add corresponding elements of v to slice elements.template<class _Dom> void operator-= (const _Expr< _Dom, _Tp > &) constvoid operator-= (const valarray< _Tp > &) constβ Subtract corresponding elements of v from slice elements.template<class _Dom> void operator/= (const _Expr< _Dom, _Tp > &) constvoid operator/= (const valarray< _Tp > &) constβ Divide slice elements by corresponding elements of v.template<class _Dom> void operator<<= (const _Expr< _Dom, _Tp > &) constvoid operator<<= (const valarray< _Tp > &) constβ Left shift slice elements by corresponding elements of v.template<class _Dom> void operator= (const _Expr< _Dom, _Tp > &) consttemplate<class _Ex> void operator= (const _Expr< _Ex, _Tp > &__e) constvoid 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 > &) consttemplate<class _Dom> void operator>>= (const _Expr< _Dom, _Tp > &) constvoid operator>>= (const valarray< _Tp > &) constβ Right shift slice elements by corresponding elements of v.template<class _Dom> void operator^= (const _Expr< _Dom, _Tp > &) constvoid operator^= (const valarray< _Tp > &) constβ Logical xor slice elements with corresponding elements of v.template<class _Dom> void operator|= (const _Expr< _Dom, _Tp > &) constvoid 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