STD::MASK_ARRAY(3cxx)
okay bestie, sit down, hydrate, and get comfy: this is the manual page for std::mask_array< _Tp >, from the C++ docs, section 3cxx. Itβs literally βReference to selected subset of an array,β and itβs giving backstage-pass energy to a valarray. π
β¨
π NAME π
std::mask_array< _Tp > β Reference to selected subset of an array. Thatβs the whole name, no cap. π«Ά
β¨ SYNOPSIS β¨
First things first, you gotta include the header, bestie:
#include <valarray>
πΈ Public Types πΈ
typedef _Tp value_typeβ the element type, just vibing asvalue_type.
π§ Public Member Functions π§
Okay, this is the main-character list. Every overload is here, and yes, weβre listing all of them. π
mask_array (const mask_array &)β Copy constructor. Both slices refer to the same underlying array β same underlying tea, two sippers. π«operator%=β Modulo slice elements by corresponding elements ofv.template<class _Dom > void operator%= (const _Expr< _Dom, _Tp > &) constvoid operator%= (const valarray< _Tp > &) const
operator&=β Logical and slice elements with corresponding elements ofv.template<class _Dom > void operator&= (const _Expr< _Dom, _Tp > &) constvoid operator&= (const valarray< _Tp > &) const
operator*=β Multiply slice elements by corresponding elements ofv.template<class _Dom > void operator*= (const _Expr< _Dom, _Tp > &) constvoid operator*= (const valarray< _Tp > &) const
operator+=β Add corresponding elements ofvto slice elements.template<class _Dom > void operator+= (const _Expr< _Dom, _Tp > &) constvoid operator+= (const valarray< _Tp > &) const
operator-=β Subtract corresponding elements ofvfrom slice elements.template<class _Dom > void operator-= (const _Expr< _Dom, _Tp > &) constvoid operator-= (const valarray< _Tp > &) const
operator/=β Divide slice elements by corresponding elements ofv.template<class _Dom > void operator/= (const _Expr< _Dom, _Tp > &) constvoid operator/= (const valarray< _Tp > &) const
operator<<=β Left shift slice elements by corresponding elements ofv.template<class _Dom > void operator<<= (const _Expr< _Dom, _Tp > &) constvoid operator<<= (const valarray< _Tp > &) const
operator=β the assignment overloads, all lined up: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 tot.mask_array & operator= (const mask_array &)β Assignment operator. Assigns elements to corresponding elements ofa.void operator= (const valarray< _Tp > &) const
operator>>=β Right shift slice elements by corresponding elements ofv.template<class _Dom > void operator>>= (const _Expr< _Dom, _Tp > &) constvoid operator>>= (const valarray< _Tp > &) const
operator^=β Logical xor slice elements with corresponding elements ofv.template<class _Dom > void operator^= (const _Expr< _Dom, _Tp > &) constvoid operator^= (const valarray< _Tp > &) const
operator|=β Logical or slice elements with corresponding elements ofv.template<class _Dom > void operator|= (const _Expr< _Dom, _Tp > &) constvoid operator|= (const valarray< _Tp > &) const
π¦ Friends π¦
class valarray< _Tp >
π₯ Detailed Description π₯
The docs literally print this class signature, stray quote and all β Iβm keeping it exactly because we donβt edit the source tea:
template<class _Tp>
class std::mask_array< _Tp >"Reference to selected subset of an array.
Now the plot: a mask_array is a reference to the actual elements of an array specified by a bitmask in the form of an array of bool. The way to get a mask_array is to call operator[](valarray<bool>) on a valarray. The returned mask_array then permits carrying operations out on the referenced subset of elements in the original valarray. Itβs like a VIP list for elements only. ποΈ
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. Two little icons made it past the velvet rope. π«Ά
π Parameters π
Tpβ Element type. Thatβs it, thatβs the parameter.
π Member Function Documentation π
These are the ones the docs call out again, with their exact signatures. Yes, weβre repeating them because the manual does β consistency slay. π
template<class _Tp > void std::mask_array< _Tp >::operator%= (const valarray< _Tp > &) constβ Modulo slice elements by corresponding elements ofv.template<class _Tp > void std::mask_array< _Tp >::operator&= (const valarray< _Tp > &) constβ Logical and slice elements with corresponding elements ofv.template<class _Tp > void std::mask_array< _Tp >::operator*= (const valarray< _Tp > &) constβ Multiply slice elements by corresponding elements ofv.template<class _Tp > void std::mask_array< _Tp >::operator+= (const valarray< _Tp > &) constβ Add corresponding elements ofvto slice elements.template<class _Tp > void std::mask_array< _Tp >::operator-= (const valarray< _Tp > &) constβ Subtract corresponding elements ofvfrom slice elements.template<class _Tp > void std::mask_array< _Tp >::operator/= (const valarray< _Tp > &) constβ Divide slice elements by corresponding elements ofv.template<class _Tp > void std::mask_array< _Tp >::operator<<= (const valarray< _Tp > &) constβ Left shift slice elements by corresponding elements ofv.template<class _Tp > void std::mask_array< _Tp >::operator>>= (const valarray< _Tp > &) constβ Right shift slice elements by corresponding elements ofv.template<class _Tp > void std::mask_array< _Tp >::operator^= (const valarray< _Tp > &) constβ Logical xor slice elements with corresponding elements ofv.template<class _Tp > void std::mask_array< _Tp >::operator|= (const valarray< _Tp > &) constβ Logical or slice elements with corresponding elements ofv.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. The robots wrote this one, and honestly they ate. π€β¨
π source/version: libstdc++ Β· page: std::mask_array< _Tp >(3cxx) Β· date: no date shown on this page, bestie. mwah π
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms