NUMERIC_ARRAYS(3)

πŸ“¦ version 4.4.0, in nixpkgs unstable

✨ NAME ✨

Numeric Arrays β€” ok so this is the <numeric arrays> corner of the C++ standard library, bestie, and it's all about the number-crunching array family πŸ’…

You're reading the Numeric Arrays(3) page from the Library Functions Manual, and honestly? It's giving "the whole valarray cinematic universe." Let me walk you through it 🫢


🌸 Classes 🌸

These are the actual types, and yes, every single one is inside std::, no cap:

  • class std::gslice β€” class defining a multi-dimensional subset of an array. Like a slice but with dimensions, main character energy πŸ”₯
  • class std::gslice_array< _Tp > β€” a reference to a multi-dimensional subset of an array. It doesn't own anything, it's just pointing at the vibe ✨
  • class std::indirect_array< _Tp > β€” a reference to an arbitrary subset of an array. Arbitrary?? iconic, she does what she wants πŸ’€
  • class std::mask_array< _Tp > β€” a reference to a selected subset of an array. Selection based, curated, lowkey editorial πŸŽ€
  • class std::slice β€” class defining a one-dimensional subset of an array. Simple, classic, she ate πŸ’–
  • class std::slice_array< _Tp > β€” a reference to a one-dimensional subset of an array. Slice's little reference buddy πŸ¦‹
  • class std::valarray< _Tp > β€” the big one πŸ‘‘ a smart array designed to support numeric processing. That's her whole purpose, that's her lore

🌈 Defines 🌈

These are the internal macro names, and I'm gonna give them to you exactly as they appear on the page, character for character, because that's the rule and I respect the rule πŸ’―

#define _DEFINE_BINARY_OPERATOR(_Op, _Name)
#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name)
#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name)
#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name)
#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name)
#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name)
#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name)
#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name)

and yeah β€” _DEFINE_VALARRAY_OPERATOR(_Op, _Name)</p> is listed four times in a row 😭 not a typo on my end, that's literally what the page says, so I'm keeping all four, periodt. We don't erase history here πŸ’…

Every one of these takes two parameters, _Op and _Name, and every one of them is an underscore-prefixed internal-looking macro β€” so unless you're deep in the implementation, these are very much iykyk territory 🧚

heads up bestie: these #defines have no description text on the page at all, so I'm not about to invent one for them β€” I'm just showing you they exist, exactly as written 🌸

okay that's the roster, more coming in the next parts β€” stay with me πŸ¦‹πŸ’œ

✨ Functions ✨

okay bestie, this is the big one β€” every single signature in the list, not a crumb skipped. grab a snack πŸ“, we're going in order.

the apply() girlies 🌸

  • _Expr< _RefFunClos< _ValArray, _Tp >, _Tp > std::valarray::apply (_Tp func(const _Tp &)) const β€” takes a function that gets each element by const reference, and hands back one of those _Expr situations.
  • _Expr< _ValFunClos< _ValArray, _Tp >, _Tp > std::valarray::apply (_Tp func(_Tp)) const β€” same energy, but the function takes _Tp by value this time. both are const members, both return _Expr, neither returns a plain valarray. iykyk πŸ’…

shifting & slicing royalty πŸ‘‘

  • valarray< _Tp > std::valarray::cshift (int) const β€” circular shift, takes an int, const member, returns a fresh valarray< _Tp >. slay.

constructors doing constructor things πŸŽ€

  • std::gslice::gslice (const gslice &) β€” the copy constructor. classic.
  • std::gslice::gslice (size_t, const valarray< size_t > &, const valarray< size_t > &) β€” the big three-arg one: a size_t plus two valarray< size_t > references. main character energy fr.
  • std::gslice::gslice () β€” the no-arg default one, living her simple life.
  • std::gslice_array::gslice_array (const gslice_array &) β€” copy constructor, doing exactly what it says.
  • std::indirect_array::indirect_array (const indirect_array &) β€” same deal, indirect flavour.
  • std::mask_array::mask_array (const mask_array &) β€” and the masked one. all three copy constructors, all accounted for 🫢

maxing & minning πŸ’–

  • _Tp std::valarray::max () const β€” const member, gives you back a _Tp. the biggest vibe.
  • _Tp std::valarray::min () const β€” const member, gives you back a _Tp. the smallest vibe.

the ! moment ⭐

  • _UnaryOp< __logical_not >::_Rt std::valarray::operator! () const β€” unary !, const member, returns that _UnaryOp< __logical_not >::_Rt type. not me getting excited over a logical not 😭

operator!= β€” the not-equal trio 🌈

three flavours, because of course there are three:

  • template<typename _Tp > _Expr< _BinClos< __not_equal_to, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __not_equal_to, _Tp >::result_type > std::operator!= (const _Tp &__t, const valarray< _Tp > &__v) β€” _Constant on the left, _ValArray on the right.
  • template<typename _Tp > _Expr< _BinClos< __not_equal_to, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __not_equal_to, _Tp >::result_type > std::operator!= (const valarray< _Tp > &__v, const _Tp &__t) β€” flipped: _ValArray then _Constant.
  • template<typename _Tp > _Expr< _BinClos< __not_equal_to, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __not_equal_to, _Tp >::result_type > std::operator!= (const valarray< _Tp > &__v, const valarray< _Tp > &__w) β€” the double-valarray icon that it is.

operator% β€” modulus, three ways πŸ’«

  • template<typename _Tp > _Expr< _BinClos< __modulus, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __modulus, _Tp >::result_type > std::operator% (const _Tp &__t, const valarray< _Tp > &__v) β€” _Constant, _ValArray.
  • template<typename _Tp > _Expr< _BinClos< __modulus, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __modulus, _Tp >::result_type > std::operator% (const valarray< _Tp > &__v, const _Tp &__t) β€” _ValArray, _Constant.
  • template<typename _Tp > _Expr< _BinClos< __modulus, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __modulus, _Tp >::result_type > std::operator% (const valarray< _Tp > &__v, const valarray< _Tp > &__w) β€” _ValArray, _ValArray. the full set, zero notes πŸ’€

operator%= β€” the eleven-course meal 🍽️

bestie this one shows up eleven times, so let's go:

  • template<class _Dom > void std::slice_array::operator%= (const _Expr< _Dom, _Tp > &) const
  • void std::slice_array::operator%= (const valarray< _Tp > &) const
  • template<class _Dom > void std::mask_array::operator%= (const _Expr< _Dom, _Tp > &) const
  • void std::mask_array::operator%= (const valarray< _Tp > &) const
  • template<class _Dom > void std::indirect_array::operator%= (const _Expr< _Dom, _Tp > &) const
  • void std::indirect_array::operator%= (const valarray< _Tp > &) const
  • template<class _Dom > void std::gslice_array::operator%= (const _Expr< _Dom, _Tp > &) const
  • void std::gslice_array::operator%= (const valarray< _Tp > &) const
  • template<class _Dom > valarray< _Tp > & std::valarray::operator%= (const _Expr< _Dom, _Tp > &)
  • valarray< _Tp > & std::valarray::operator%= (const valarray< _Tp > &)
  • valarray< _Tp > & std::valarray::operator%= (const _Tp &)

notice the little glow-up: the four helper-array versions are void and const members, while the three valarray ones return valarray< _Tp > & and are not const. periodt.

operator& β€” bitwise besties πŸ¦‹

  • template<typename _Tp > _Expr< _BinClos< __bitwise_and, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __bitwise_and, _Tp >::result_type > std::operator& (const _Tp &__t, const valarray< _Tp > &__v)
  • template<typename _Tp > _Expr< _BinClos< __bitwise_and, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __bitwise_and, _Tp >::result_type > std::operator& (const valarray< _Tp > &__v, const _Tp &__t)
  • template<typename _Tp > _Expr< _BinClos< __bitwise_and, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __bitwise_and, _Tp >::result_type > std::operator& (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

constant-valarray, valarray-constant, valarray-valarray. the holy trinity lowkey πŸ”₯

operator&& β€” the logical and trio 🧚

  • template<typename _Tp > _Expr< _BinClos< __logical_and, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __logical_and, _Tp >::result_type > std::operator&& (const _Tp &__t, const valarray< _Tp > &__v)
  • template<typename _Tp > _Expr< _BinClos< __logical_and, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __logical_and, _Tp >::result_type > std::operator&& (const valarray< _Tp > &__v, const _Tp &__t)
  • template<typename _Tp > _Expr< _BinClos< __logical_and, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __logical_and, _Tp >::result_type > std::operator&& (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

same three-flavour pattern, logical edition. we love consistency πŸ’œ

operator&= β€” yup, eleven again πŸ™ˆ

  • template<class _Dom > void std::slice_array::operator&= (const _Expr< _Dom, _Tp > &) const
  • void std::slice_array::operator&= (const valarray< _Tp > &) const
  • template<class _Dom > void std::mask_array::operator&= (const _Expr< _Dom, _Tp > &) const
  • void std::mask_array::operator&= (const valarray< _Tp > &) const
  • template<class _Dom > void std::indirect_array::operator&= (const _Expr< _Dom, _Tp > &) const
  • void std::indirect_array::operator&= (const valarray< _Tp > &) const
  • template<class _Dom > void std::gslice_array::operator&= (const _Expr< _Dom, _Tp > &) const
  • void std::gslice_array::operator&= (const valarray< _Tp > &) const
  • template<class _Dom > valarray< _Tp > & std::valarray::operator&= (const _Expr< _Dom, _Tp > &)
  • valarray< _Tp > & std::valarray::operator&= (const valarray< _Tp > &)
  • valarray< _Tp > & std::valarray::operator&= (const _Tp &)

same void x const situation on the helpers, same valarray< _Tp > & on the valarray ones. no cap. πŸ’…

operator* β€” multiply era 🌟

  • template<typename _Tp > _Expr< _BinClos< __multiplies, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __multiplies, _Tp >::result_type > std::operator* (const _Tp &__t, const valarray< _Tp > &__v)
  • template<typename _Tp > _Expr< _BinClos< __multiplies, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __multiplies, _Tp >::result_type > std::operator* (const valarray< _Tp > &__v, const _Tp &__t)
  • template<typename _Tp > _Expr< _BinClos< __multiplies, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __multiplies, _Tp >::result_type > std::operator* (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

the __multiplies clique, all three present and accounted for 🫢

operator*= β€” the eleven, take three πŸ’€

  • template<class _Dom > void std::slice_array::operator*= (const _Expr< _Dom, _Tp > &) const
  • void std::slice_array::operator*= (const valarray< _Tp > &) const
  • template<class _Dom > void std::mask_array::operator*= (const _Expr< _Dom, _Tp > &) const
  • void std::mask_array::operator*= (const valarray< _Tp > &) const
  • template<class _Dom > void std::indirect_array::operator*= (const _Expr< _Dom, _Tp > &) const
  • void std::indirect_array::operator*= (const valarray< _Tp > &) const
  • template<class _Dom > void std::gslice_array::operator*= (const _Expr< _Dom, _Tp > &) const
  • void std::gslice_array::operator*= (const valarray< _Tp > &) const
  • template<class _Dom > valarray< _Tp > & std::valarray::operator*= (const _Expr< _Dom, _Tp > &)
  • valarray< _Tp > & std::valarray::operator*= (const valarray< _Tp > &)
  • valarray< _Tp > & std::valarray::operator*= (const _Tp &)

yes bestie, same eleven. it's giving commitment to the bit ✨

operator+, unary edition β˜€οΈ

  • _UnaryOp< __unary_plus >::_Rt std::valarray::operator+ () const β€” unary plus, const member, returns _UnaryOp< __unary_plus >::_Rt. a whole mood.

operator+, the binary trio 🌼

  • template<typename _Tp > _Expr< _BinClos< __plus, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __plus, _Tp >::result_type > std::operator+ (const _Tp &__t, const valarray< _Tp > &__v)
  • template<typename _Tp > _Expr< _BinClos< __plus, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __plus, _Tp >::result_type > std::operator+ (const valarray< _Tp > &__v, const _Tp &__t)
  • template<typename _Tp > _Expr< _BinClos< __plus, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __plus, _Tp >::result_type > std::operator+ (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

__plus three ways, as the universe intended πŸ’–

operator+= β€” eleven course meal, part four 🍰

  • template<class _Dom > void std::slice_array::operator+= (const _Expr< _Dom, _Tp > &) const
  • void std::slice_array::operator+= (const valarray< _Tp > &) const
  • template<class _Dom > void std::mask_array::operator+= (const _Expr< _Dom, _Tp > &) const
  • void std::mask_array::operator+= (const valarray< _Tp > &) const
  • template<class _Dom > void std::indirect_array::operator+= (const _Expr< _Dom, _Tp > &) const
  • void std::indirect_array::operator+= (const valarray< _Tp > &) const
  • template<class _Dom > void std::gslice_array::operator+= (const _Expr< _Dom, _Tp > &) const
  • void std::gslice_array::operator+= (const valarray< _Tp > &) const
  • template<class _Dom > valarray< _Tp > & std::valarray::operator+= (const _Expr< _Dom, _Tp > &)
  • valarray< _Tp > & std::valarray::operator+= (const valarray< _Tp > &)
  • valarray< _Tp > & std::valarray::operator+= (const _Tp &)

still iconic, still eleven, still the same return-type pattern πŸŽ€

operator-, unary edition πŸŒ™

  • _UnaryOp< __negate >::_Rt std::valarray::operator- () const β€” unary minus! __negate! const! returns _UnaryOp< __negate >::_Rt. she's the moment.

operator-, the binary trio 🧊

  • template<typename _Tp > _Expr< _BinClos< __minus, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __minus, _Tp >::result_type > std::operator- (const _Tp &__t, const valarray< _Tp > &__v)
  • template<typename _Tp > _Expr< _BinClos< __minus, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __minus, _Tp >::result_type > std::operator- (const valarray< _Tp > &__v, const _Tp &__t)
  • template<typename _Tp > _Expr< _BinClos< __minus, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __minus, _Tp >::result_type > std::operator- (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

constant-valarray, valarray-constant, valarray-valarray. __minus ate and left no crumbs πŸ”₯

operator-= β€” bestie it's eleven again 😭

  • template<class _Dom > void std::slice_array::operator-= (const _Expr< _Dom, _Tp > &) const
  • void std::slice_array::operator-= (const valarray< _Tp > &) const
  • template<class _Dom > void std::mask_array::operator-= (const _Expr< _Dom, _Tp > &) const
  • void std::mask_array::operator-= (const valarray< _Tp > &) const
  • template<class _Dom > void std::indirect_array::operator-= (const _Expr< _Dom, _Tp > &) const
  • void std::indirect_array::operator-= (const valarray< _Tp > &) const
  • template<class _Dom > void std::gslice_array::operator-= (const _Expr< _Dom, _Tp > &) const
  • void std::gslice_array::operator-= (const valarray< _Tp > &) const
  • template<class _Dom > valarray< _Tp > & std::valarray::operator-= (const _Expr< _Dom, _Tp > &)
  • valarray< _Tp > & std::valarray::operator-= (const valarray< _Tp > &)
  • valarray< _Tp > & std::valarray::operator-= (const _Tp &)

all the subtract-assign besties in one place, you're welcome 🫢

operator/ β€” divide era πŸ¦‹

  • template<typename _Tp > _Expr< _BinClos< __divides, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __divides, _Tp >::result_type > std::operator/ (const _Tp &__t, const valarray< _Tp > &__v)
  • template<typename _Tp > _Expr< _BinClos< __divides, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __divides, _Tp >::result_type > std::operator/ (const valarray< _Tp > &__v, const _Tp &__t)
  • template<typename _Tp > _Expr< _BinClos< __divides, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __divides, _Tp >::result_type > std::operator/ (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

__divides showing up with the full three-part serve ⭐

operator/= β€” starting the run πŸ’«

  • template<class _Dom > void std::slice_array::operator/= (const _Expr< _Dom, _Tp > &) const
  • void std::slice_array::operator/= (const valarray< _Tp > &) const
  • template<class _Dom > void std::mask_array::operator/= (const _Expr< _Dom, _Tp > &) const
  • void std::mask_array::operator/= (const valarray< _Tp > &) const

okay bestie we are STILL in the synopsis trenches and the operator list is lowkey iconic β€” it's giving "every assignment operator ever invented" πŸ’… every single signature is here, character for character, so don't skip a line, iykyk.


the /= era, aka divide-and-conquer energy πŸ“

indirect_array and gslice_array both do the /= thing, and then valarray itself shows up with three whole flavors:

template<class _Dom > void std::indirect_array::operator/= (const _Expr< _Dom, _Tp > &) const
void std::indirect_array::operator/= (const valarray< _Tp > &) const
template<class _Dom > void std::gslice_array::operator/= (const _Expr< _Dom, _Tp > &) const
void std::gslice_array::operator/= (const valarray< _Tp > &) const
template<class _Dom > valarray< _Tp > & std::valarray::operator/= (const _Expr< _Dom, _Tp > &)
valarray< _Tp > & std::valarray::operator/= (const valarray< _Tp > &)
valarray< _Tp > & std::valarray::operator/= (const _Tp &)

notice how the array-ish helpers return void but the actual valarray returns valarray< _Tp > &? that's your little tell, bestie πŸ‘€


less-than, the og comparison < 🌸

three overloads, because of course there are three β€” constant-vs-valarray, valarray-vs-constant, and valarray-vs-valarray:

template<typename _Tp > _Expr< _BinClos< __less, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __less, _Tp >::result_type > std::operator< (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __less, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __less, _Tp >::result_type > std::operator< (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __less, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __less, _Tp >::result_type > std::operator< (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

the way __less just keeps showing up in every single one 😭 that's the whole motif, fr fr.


left shift << and where it goes 🌈

first the free operators β€” __shift_left, same three-way pattern:

template<typename _Tp > _Expr< _BinClos< __shift_left, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __shift_left, _Tp >::result_type > std::operator<< (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __shift_left, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __shift_left, _Tp >::result_type > std::operator<< (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __shift_left, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __shift_left, _Tp >::result_type > std::operator<< (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

then the compound <<= β€” and babes, every array-view class gets a turn plus the main valarray:

template<class _Dom > void std::slice_array::operator<<= (const _Expr< _Dom, _Tp > &) const
void std::slice_array::operator<<= (const valarray< _Tp > &) const
template<class _Dom > void std::mask_array::operator<<= (const _Expr< _Dom, _Tp > &) const
void std::mask_array::operator<<= (const valarray< _Tp > &) const
template<class _Dom > void std::indirect_array::operator<<= (const _Expr< _Dom, _Tp > &) const
void std::indirect_array::operator<<= (const valarray< _Tp > &) const
template<class _Dom > void std::gslice_array::operator<<= (const _Expr< _Dom, _Tp > &) const
void std::gslice_array::operator<<= (const valarray< _Tp > &) const
template<class _Dom > valarray< _Tp > & std::valarray::operator<<= (const _Expr< _Dom, _Tp > &)
valarray< _Tp > & std::valarray::operator<<= (const valarray< _Tp > &)
valarray< _Tp > & std::valarray::operator<<= (const _Tp &)

slice_array β†’ mask_array β†’ indirect_array β†’ gslice_array β†’ valarray, in that exact order. the consistency? we love to see it ✨


less-than-or-equal <= πŸŽ€

same three-way trio, just with __less_equal:

template<typename _Tp > _Expr< _BinClos< __less_equal, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __less_equal, _Tp >::result_type > std::operator<= (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __less_equal, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __less_equal, _Tp >::result_type > std::operator<= (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __less_equal, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __less_equal, _Tp >::result_type > std::operator<= (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

the big one: operator= πŸ‘‘πŸ’€

okay this is the main character of the section, and it is LONG. buckle up.

slice_array β€” four whole overloads, including the _Tp one and the self-assign:

template<class _Dom > void std::slice_array::operator= (const _Expr< _Dom, _Tp > &) const
void std::slice_array::operator= (const valarray< _Tp > &) const
void std::slice_array::operator= (const _Tp &) const
slice_array & std::slice_array::operator= (const slice_array &)

mask_array β€” same deal, but its template param is named _Ex and the arg is __e, not _Dom. don't you dare "fix" that πŸ™ˆ:

template<class _Ex > void std::mask_array::operator= (const _Expr< _Ex, _Tp > &__e) const
void std::mask_array::operator= (const valarray< _Tp > &) const
void std::mask_array::operator= (const _Tp &) const
mask_array & std::mask_array::operator= (const mask_array &)

indirect_array β€” four, and yes it returns indirect_array &:

template<class _Dom > void std::indirect_array::operator= (const _Expr< _Dom, _Tp > &) const
void std::indirect_array::operator= (const valarray< _Tp > &) const
void std::indirect_array::operator= (const _Tp &) const
indirect_array & std::indirect_array::operator= (const indirect_array &)

gslice_array β€” four more:

template<class _Dom > void std::gslice_array::operator= (const _Expr< _Dom, _Tp > &) const
void std::gslice_array::operator= (const valarray< _Tp > &) const
void std::gslice_array::operator= (const _Tp &) const
gslice_array & std::gslice_array::operator= (const gslice_array &)

gslice itself, being all simple and self-assigning:

gslice & std::gslice::operator= (const gslice &)

and finally the queen, valarray::operator= β€” eight overloads, and the initializer_list one returns just valarray & while the rest return valarray< _Tp > &. yes, we clocked that. yes, it matters. periodt:

template<class _Dom > valarray< _Tp > & std::valarray::operator= (const _Expr< _Dom, _Tp > &)
valarray< _Tp > & std::valarray::operator= (const indirect_array< _Tp > &)
valarray< _Tp > & std::valarray::operator= (const mask_array< _Tp > &)
valarray< _Tp > & std::valarray::operator= (const gslice_array< _Tp > &)
valarray< _Tp > & std::valarray::operator= (const slice_array< _Tp > &)
valarray< _Tp > & std::valarray::operator= (const _Tp &)
valarray & std::valarray::operator= (initializer_list< _Tp >)
valarray< _Tp > & std::valarray::operator= (const valarray< _Tp > &)
lowkey obsessed that indirect_array, mask_array, gslice_array and slice_array all get their own assign-from-view overload up in here. it's giving "everybody gets a seat at the table" 🫢

equality == πŸ¦‹

the classic three-way, __equal_to edition:

template<typename _Tp > _Expr< _BinClos< __equal_to, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __equal_to, _Tp >::result_type > std::operator== (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __equal_to, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __equal_to, _Tp >::result_type > std::operator== (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __equal_to, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __equal_to, _Tp >::result_type > std::operator== (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

greater-than > πŸ”₯ and greater-or-equal >= ⭐

shockingly (not shockingly) it's the same trio twice, once with __greater and once with __greater_equal:

template<typename _Tp > _Expr< _BinClos< __greater, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __greater, _Tp >::result_type > std::operator> (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __greater, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __greater, _Tp >::result_type > std::operator> (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __greater, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __greater, _Tp >::result_type > std::operator> (const valarray< _Tp > &__v, const valarray< _Tp > &__w)
template<typename _Tp > _Expr< _BinClos< __greater_equal, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __greater_equal, _Tp >::result_type > std::operator>= (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __greater_equal, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __greater_equal, _Tp >::result_type > std::operator>= (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __greater_equal, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __greater_equal, _Tp >::result_type > std::operator>= (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

right shift >> and >>= πŸŒ™

right shift gets the same three free operators, now with __shift_right:

template<typename _Tp > _Expr< _BinClos< __shift_right, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __shift_right, _Tp >::result_type > std::operator>> (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __shift_right, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __shift_right, _Tp >::result_type > std::operator>> (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __shift_right, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __shift_right, _Tp >::result_type > std::operator>> (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

and the compound >>=, which is literally the <<= block with the arrow flipped β€” same five classes, same void-vs-valarray< _Tp > & split:

template<class _Dom > void std::slice_array::operator>>= (const _Expr< _Dom, _Tp > &) const
void std::slice_array::operator>>= (const valarray< _Tp > &) const
template<class _Dom > void std::mask_array::operator>>= (const _Expr< _Dom, _Tp > &) const
void std::mask_array::operator>>= (const valarray< _Tp > &) const
template<class _Dom > void std::indirect_array::operator>>= (const _Expr< _Dom, _Tp > &) const
void std::indirect_array::operator>>= (const valarray< _Tp > &) const
template<class _Dom > void std::gslice_array::operator>>= (const _Expr< _Dom, _Tp > &) const
void std::gslice_array::operator>>= (const valarray< _Tp > &) const
template<class _Dom > valarray< _Tp > & std::valarray::operator>>= (const _Expr< _Dom, _Tp > &)
valarray< _Tp > & std::valarray::operator>>= (const valarray< _Tp > &)
valarray< _Tp > & std::valarray::operator>>= (const _Tp &)

the way >> and >>= just mirrored the entire previous section… consistent queen behavior πŸ’œ


operator[], aka the whole reason the other classes exist πŸ‘‘πŸ’…

okay this is THE subsection β€” every way you can index a valarray. look at all these return types, they're literally the star cast of the page:

indirect_array< _Tp > std::valarray::operator[] (const valarray< size_t > &)
_Expr< _IClos< _ValArray, _Tp >, _Tp > std::valarray::operator[] (const valarray< size_t > &) const
mask_array< _Tp > std::valarray::operator[] (const valarray< bool > &)
valarray< _Tp > std::valarray::operator[] (const valarray< bool > &) const
gslice_array< _Tp > std::valarray::operator[] (const gslice &)
_Expr< _GClos< _ValArray, _Tp >, _Tp > std::valarray::operator[] (const gslice &) const
slice_array< _Tp > std::valarray::operator[] (slice)
_Expr< _SClos< _ValArray, _Tp >, _Tp > std::valarray::operator[] (slice) const
_Tp & std::valarray::operator[] (size_t)
const _Tp & std::valarray::operator[] (size_t) const

so: valarray< size_t > β†’ indirect_array (_IClos on the const side), valarray< bool > β†’ mask_array (but plain valarray< _Tp > when const, yes really, look again), gslice β†’ gslice_array (_GClos when const), slice β†’ slice_array (_SClos when const), and plain old size_t β†’ a _Tp & (or const _Tp & for the const one). πŸŽ€


bitwise xor ^ and ^= 🧚

the trio, with __bitwise_xor:

template<typename _Tp > _Expr< _BinClos< __bitwise_xor, _Constant, _ValArray, _Tp, _Tp >, typename __fun< __bitwise_xor, _Tp >::result_type > std::operator^ (const _Tp &__t, const valarray< _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __bitwise_xor, _ValArray, _Constant, _Tp, _Tp >, typename __fun< __bitwise_xor, _Tp >::result_type > std::operator^ (const valarray< _Tp > &__v, const _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __bitwise_xor, _ValArray, _ValArray, _Tp, _Tp >, typename __fun< __bitwise_xor, _Tp >::result_type > std::operator^ (const valarray< _Tp > &__v, const valarray< _Tp > &__w)

and the compound ^= across the four view classes:

template<class _Dom > void std::slice_array::operator^= (const _Expr< _Dom, _Tp > &) const
void std::slice_array::operator^= (const valarray< _Tp > &) const
template<class _Dom > void std::mask_array::operator^= (const _Expr< _Dom, _Tp > &) const
void std::mask_array::operator^= (const valarray< _Tp > &) const
template<class _Dom > void std::indirect_array::operator^= (const _Expr< _Dom, _Tp > &) const
void std::indirect_array::operator^= (const valarray< _Tp > &) const
template<class _Dom > void std::gslice_array::operator^= (const _Expr< _Dom, _Tp > &) const
void std::gslice_array::operator^= (const valarray< _Tp > &) const

every single one returns void and takes const, no cap. and that's exactly where this chunk leaves us, bestie ✨ πŸ¦‹

template<class _Dom > valarray< _Tp > & std::valarray::operator^= (const
    _Expr< _Dom, _Tp > &)
valarray< _Tp > & std::valarray::operator^= (const valarray< _Tp > &)
valarray< _Tp > & std::valarray::operator^= (const _Tp &)
template<typename _Tp > _Expr< _BinClos< __bitwise_or, _Constant,
    _ValArray, _Tp, _Tp >, typename __fun< __bitwise_or, _Tp
    >::result_type > std::operator| (const _Tp &__t, const valarray< _Tp
    > &__v)
template<typename _Tp > _Expr< _BinClos< __bitwise_or, _ValArray,
    _Constant, _Tp, _Tp >, typename __fun< __bitwise_or, _Tp
    >::result_type > std::operator| (const valarray< _Tp > &__v, const
    _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __bitwise_or, _ValArray,
    _ValArray, _Tp, _Tp >, typename __fun< __bitwise_or, _Tp
    >::result_type > std::operator| (const valarray< _Tp > &__v, const
    valarray< _Tp > &__w)
template<class _Dom > void std::slice_array::operator|= (const _Expr<
    _Dom, _Tp > &) const
void std::slice_array::operator|= (const valarray< _Tp > &) const
template<class _Dom > void std::mask_array::operator|= (const _Expr<
    _Dom, _Tp > &) const
void std::mask_array::operator|= (const valarray< _Tp > &) const
template<class _Dom > void std::indirect_array::operator|= (const _Expr<
    _Dom, _Tp > &) const
void std::indirect_array::operator|= (const valarray< _Tp > &) const
template<class _Dom > void std::gslice_array::operator|= (const _Expr<
    _Dom, _Tp > &) const
void std::gslice_array::operator|= (const valarray< _Tp > &) const
template<class _Dom > valarray< _Tp > & std::valarray::operator|= (const
    _Expr< _Dom, _Tp > &)
valarray< _Tp > & std::valarray::operator|= (const valarray< _Tp > &)
valarray< _Tp > & std::valarray::operator|= (const _Tp &)
template<typename _Tp > _Expr< _BinClos< __logical_or, _Constant,
    _ValArray, _Tp, _Tp >, typename __fun< __logical_or, _Tp
    >::result_type > std::operator|| (const _Tp &__t, const valarray<
    _Tp > &__v)
template<typename _Tp > _Expr< _BinClos< __logical_or, _ValArray,
    _Constant, _Tp, _Tp >, typename __fun< __logical_or, _Tp
    >::result_type > std::operator|| (const valarray< _Tp > &__v, const
    _Tp &__t)
template<typename _Tp > _Expr< _BinClos< __logical_or, _ValArray,
    _ValArray, _Tp, _Tp >, typename __fun< __logical_or, _Tp
    >::result_type > std::operator|| (const valarray< _Tp > &__v, const
    valarray< _Tp > &__w)
_UnaryOp< __bitwise_not >::_Rt std::valarray::operator~ () const
void std::valarray::resize (size_t __size, _Tp __c=_Tp())
valarray< _Tp > std::valarray::shift (int) const
size_t std::slice::size () const
valarray< size_t > std::gslice::size () const
size_t std::valarray::size () const
std::slice::slice (size_t, size_t, size_t)
std::slice::slice ()
std::slice_array::slice_array (const slice_array &)
size_t std::slice::start () const
size_t std::gslice::start () const
size_t std::slice::stride () const
valarray< size_t > std::gslice::stride () const
_Tp std::valarray::sum () const
template<class _Dom > std::valarray::valarray (const _Expr< _Dom, _Tp >
    &__e)
std::valarray::valarray (initializer_list< _Tp >)
std::valarray::valarray (const indirect_array< _Tp > &)
std::valarray::valarray (const mask_array< _Tp > &)
std::valarray::valarray (const gslice_array< _Tp > &)
std::valarray::valarray (const slice_array< _Tp > &)
std::valarray::valarray (const valarray &)
template<typename _Tp> std::valarray::valarray (const _Tp *__restrict__
    __p, size_t __n)
std::valarray::valarray (const _Tp &, size_t)
std::valarray::valarray (size_t)
std::valarray::valarray ()
std::gslice::~gslice ()

πŸ’œ Detailed Description πŸ’œ

Classes and functions for representing and manipulating arrays of elements. That's the whole vibe, bestie β€” collections of stuff, and a whole little ecosystem of helpers to poke at them. ✨


🌸 Function Documentation 🌸

🫢 apply β€” the "do a thing to everything" queen

template<class _Tp> _Expr< _RefFunClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::apply (_Tp funcconst _Tp &) const [inline, inherited]

Apply a function to the array. πŸŽ€

Returns a new valarray where every element got assigned the result of applying func to the corresponding element of this array. The new array has the same size as this one β€” no glow-ups, no shrinkage, same size periodt.

  • Parameters:
    • func β€” Function of const Tp& returning Tp to apply.
  • Returns: New valarray with transformed elements.

Definition at line 951 of file valarray.

template<class _Tp> _Expr< _ValFunClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::apply (_Tp func_Tp) const [inline, inherited]

Apply a function to the array. Same energy, different overload, we love a versatile icon πŸ‘‘

Returns a new valarray with elements assigned to the result of applying func to the corresponding element of this array. The new array has the same size as this one.

  • Parameters:
    • func β€” Function of Tp returning Tp to apply.
  • Returns: New valarray with transformed elements.

Definition at line 943 of file valarray.


πŸŒ€ cshift β€” the rotation station

template<class _Tp > valarray< _Tp > std::valarray< _Tp >::cshift (int __n) const [inline, inherited]

Return a rotated array. Literally the carousel emoji of container methods 🎠

A new valarray is constructed as a copy of this array with elements in shifted positions. For an element with index i, the new position is (i - n) % size(). The new valarray has the same size as the current one. Elements that are shifted beyond the array bounds are shifted into the other end of the array. No elements are lost. (say it louder for the people in the back, nothing gets yeeted πŸ’…)

Positive arguments shift toward index 0, wrapping around the top. Negative arguments shift towards the top, wrapping around to 0.

  • Parameters:
    • n β€” Number of element positions to rotate.
  • Returns: New valarray with elements in shifted positions.

Definition at line 869 of file valarray.

References std::valarray< _Tp >::_M_data, and std::valarray< _Tp >::_M_size.


🧚 gslice, my beloved

std::gslice::gslice (const gslice & __g) [inline, inherited]

Copy constructor. Short, sweet, iconic.

Definition at line 156 of file gslice.h.

std::gslice::gslice (size_t __o, const valarray< size_t > & __l, const valarray< size_t > & __s) [inline, inherited]

Construct a slice. 🌈

Constructs a slice with as many dimensions as the length of the l and s arrays.

  • Parameters:
    • o β€” Offset in array of first element.
    • l β€” Array of dimension lengths.
    • s β€” Array of dimension strides between array elements.

Definition at line 151 of file gslice.h.

std::gslice::gslice () [inline, inherited]

Construct an empty slice. The "no thoughts, head empty" constructor 🫧

Definition at line 147 of file gslice.h.


πŸ’« slay_array copy constructors (all of them, we're thorough)

template<typename _Tp > std::gslice_array< _Tp >::gslice_array (const gslice_array< _Tp > & __a) [inline, inherited]

Copy constructor. Both slices refer to the same underlying array. πŸ‘€ (yes, they're holding hands, same data)

Definition at line 142 of file gslice_array.h.

template<typename _Tp > std::indirect_array< _Tp >::indirect_array (const indirect_array< _Tp > & __a) [inline, inherited]

Copy constructor. Both slices refer to the same underlying array. Same deal, same shared-data situation πŸͺž

Definition at line 142 of file indirect_array.h.

template<typename _Tp > std::mask_array< _Tp >::mask_array (const mask_array< _Tp > & a) [inline, inherited]

Copy constructor. Both slices refer to the same underlying array. Third time's the charm, still sharing πŸŽ€

Definition at line 138 of file mask_array.h.


πŸ‘‘ max & min

template<typename _Tp > _Tp std::valarray< _Tp >::max () const [inline, inherited]

Return the maximum element using operator<(). The main character of your array, found and crowned πŸ”₯

Definition at line 935 of file valarray.

References std::max_element().

template<typename _Tp > _Tp std::valarray< _Tp >::min () const [inline, inherited]

Return the minimum element using operator<(). The humble fave, smallest but still valid πŸ’–

Definition at line 927 of file valarray.

References std::min_element().


😭 the unary !

template<typename _Tp > valarray< _Tp >::template _UnaryOp< __logical_not >::_Rt std::valarray< _Tp >::operator! () const [inline, inherited]

Return a new valarray by applying unary ! to each element. Not me flipping literally every single one of them πŸ™ˆ

Definition at line 970 of file valarray.


πŸ’… operator%= β€” modulo era

template<typename _Tp > void std::slice_array< _Tp >::operator%= (const valarray< _Tp > & __v) const [inline, inherited]

Modulo slice elements by corresponding elements of v.

Definition at line 257 of file slice_array.h.

template<typename _Tp > void std::mask_array< _Tp >::operator%= (const valarray< _Tp > & __v) const [inline, inherited]

Modulo slice elements by corresponding elements of v.

Definition at line 191 of file mask_array.h.

template<typename _Tp > void std::indirect_array< _Tp >::operator%= (const valarray< _Tp > & __v) const [inline, inherited]

Modulo slice elements by corresponding elements of v.

Definition at line 195 of file indirect_array.h.

template<typename _Tp > void std::gslice_array< _Tp >::operator%= (const valarray< _Tp > & __v) const [inline, inherited]

Modulo slice elements by corresponding elements of v.

Definition at line 201 of file gslice_array.h.

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator%= (const valarray< _Tp > & __v) [inline, inherited]

Modulo elements of array by corresponding elements of v.

Definition at line 997 of file valarray.

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator%= (const _Tp & __t) [inline, inherited]

Set each element e of array to e % t. One scalar, every element, chaos coordinated πŸ’«

Definition at line 997 of file valarray.


πŸ¦‹ operator&= β€” bitwise and bestie

template<typename _Tp > void std::slice_array< _Tp >::operator&= (const valarray< _Tp > & __v) const [inline, inherited]

Logical and slice elements with corresponding elements of v.

Definition at line 261 of file slice_array.h.

template<typename _Tp > void std::mask_array< _Tp >::operator&= (const valarray< _Tp > & __v) const [inline, inherited]

Logical and slice elements with corresponding elements of v.

Definition at line 195 of file mask_array.h.

template<typename _Tp > void std::indirect_array< _Tp >::operator&= (const valarray< _Tp > & __v) const [inline, inherited]

Logical and slice elements with corresponding elements of v.

Definition at line 199 of file indirect_array.h.

template<typename _Tp > void std::gslice_array< _Tp >::operator&= (const valarray< _Tp > & __v) const [inline, inherited]

Logical and slice elements with corresponding elements of v.

Definition at line 205 of file gslice_array.h.

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator&= (const valarray< _Tp > & __v) [inline, inherited]

Logical and corresponding elements of v with elements of array.

Definition at line 999 of file valarray.

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator&= (const _Tp & __t) [inline, inherited]

Set each element e of array to e & t.

Definition at line 999 of file valarray.


πŸ“ operator*= β€” multiply era

template<typename _Tp > void std::slice_array< _Tp >::operator*= (const valarray< _Tp > & __v) const [inline, inherited]

Multiply slice elements by corresponding elements of v.

Definition at line 255 of file slice_array.h.

template<typename _Tp > void std::mask_array< _Tp >::operator*= (const valarray< _Tp > & __v) const [inline, inherited]

Multiply slice elements by corresponding elements of v.

Carry-over from the previous part: Definition at line 189 of file mask_array.h.

  • template<typename _Tp > void std::indirect_array< _Tp >::operator*= (const valarray< _Tp > & __v) const [inline, inherited] β€” multiplies the slice elements by the matching elements of v. Definition at line 193 of file indirect_array.h.
  • template<typename _Tp > void std::gslice_array< _Tp >::operator*= (const valarray< _Tp > & __v) const [inline, inherited] β€” multiplies the slice elements by the matching elements of v. Definition at line 199 of file gslice_array.h.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator*= (const valarray< _Tp > & __v) [inline, inherited] β€” multiplies the array’s elements by the corresponding elements of v. Definition at line 995 of file valarray.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator*= (const _Tp & __t) [inline, inherited] β€” multiplies every element of the array by t. Definition at line 995 of file valarray.
  • template<typename _Tp > valarray< _Tp >::template _UnaryOp< __unary_plus >::_Rt std::valarray< _Tp >::operator+ () const [inline, inherited] β€” returns a brand-new valarray by applying unary + to every element. Definition at line 967 of file valarray.
  • template<typename _Tp > void std::slice_array< _Tp >::operator+= (const valarray< _Tp > & __v) const [inline, inherited] β€” adds the corresponding elements of v into the slice elements. Definition at line 258 of file slice_array.h.
  • template<typename _Tp > void std::mask_array< _Tp >::operator+= (const valarray< _Tp > & __v) const [inline, inherited] β€” adds the corresponding elements of v into the slice elements. Definition at line 192 of file mask_array.h.
  • template<typename _Tp > void std::indirect_array< _Tp >::operator+= (const valarray< _Tp > & __v) const [inline, inherited] β€” adds the corresponding elements of v into the slice elements. Definition at line 196 of file indirect_array.h.
  • template<typename _Tp > void std::gslice_array< _Tp >::operator+= (const valarray< _Tp > & __v) const [inline, inherited] β€” adds the corresponding elements of v into the slice elements. Definition at line 202 of file gslice_array.h.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator+= (const valarray< _Tp > & __v) [inline, inherited] β€” adds the corresponding elements of v to the array’s elements. Definition at line 993 of file valarray.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator+= (const _Tp & __t) [inline, inherited] β€” adds t to every element of the array. Definition at line 993 of file valarray.
  • template<typename _Tp > valarray< _Tp >::template _UnaryOp< __negate >::_Rt std::valarray< _Tp >::operator- () const [inline, inherited] β€” returns a fresh valarray by applying unary - to every element. Definition at line 968 of file valarray.
  • template<typename _Tp > void std::slice_array< _Tp >::operator-= (const valarray< _Tp > & __v) const [inline, inherited] β€” subtracts the corresponding elements of v from the slice elements. Definition at line 259 of file slice_array.h.
  • template<typename _Tp > void std::mask_array< _Tp >::operator-= (const valarray< _Tp > & __v) const [inline, inherited] β€” subtracts the corresponding elements of v from the slice elements. Definition at line 193 of file mask_array.h.
  • template<typename _Tp > void std::indirect_array< _Tp >::operator-= (const valarray< _Tp > & __v) const [inline, inherited] β€” subtracts the corresponding elements of v from the slice elements. Definition at line 197 of file indirect_array.h.
  • template<typename _Tp > void std::gslice_array< _Tp >::operator-= (const valarray< _Tp > & __v) const [inline, inherited] β€” subtracts the corresponding elements of v from the slice elements. Definition at line 203 of file gslice_array.h.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator-= (const valarray< _Tp > & __v) [inline, inherited] β€” subtracts the corresponding elements of v from the array’s elements. Definition at line 994 of file valarray.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator-= (const _Tp & __t) [inline, inherited] β€” subtracts t from every element of the array. Definition at line 994 of file valarray.
  • template<typename _Tp > void std::slice_array< _Tp >::operator/= (const valarray< _Tp > & __v) const [inline, inherited] β€” divides the slice elements by the matching elements of v. Definition at line 256 of file slice_array.h.
  • template<typename _Tp > void std::mask_array< _Tp >::operator/= (const valarray< _Tp > & __v) const [inline, inherited] β€” divides the slice elements by the matching elements of v. Definition at line 190 of file mask_array.h.
  • template<typename _Tp > void std::indirect_array< _Tp >::operator/= (const valarray< _Tp > & __v) const [inline, inherited] β€” divides the slice elements by the matching elements of v. Definition at line 194 of file indirect_array.h.
  • template<typename _Tp > void std::gslice_array< _Tp >::operator/= (const valarray< _Tp > & __v) const [inline, inherited] β€” divides the slice elements by the matching elements of v. Definition at line 200 of file gslice_array.h.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator/= (const valarray< _Tp > & __v) [inline, inherited] β€” divides the array’s elements by the corresponding elements of v. Definition at line 996 of file valarray.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator/= (const _Tp & __t) [inline, inherited] β€” divides every element of the array by t. Definition at line 996 of file valarray.
  • template<typename _Tp > void std::slice_array< _Tp >::operator<<= (const valarray< _Tp > & __v) const [inline, inherited] β€” left-shifts the slice elements by the corresponding elements of v. Definition at line 263 of file slice_array.h.
  • template<typename _Tp > void std::mask_array< _Tp >::operator<<= (const valarray< _Tp > & __v) const [inline, inherited] β€” left-shifts the slice elements by the corresponding elements of v. Definition at line 197 of file mask_array.h.
  • template<typename _Tp > void std::indirect_array< _Tp >::operator<<= (const valarray< _Tp > & __v) const [inline, inherited] β€” left-shifts the slice elements by the corresponding elements of v. Definition at line 201 of file indirect_array.h.
  • template<typename _Tp > void std::gslice_array< _Tp >::operator<<= (const valarray< _Tp > & __v) const [inline, inherited] β€” left-shifts the slice elements by the corresponding elements of v. Definition at line 207 of file gslice_array.h.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator<<= (const valarray< _Tp > & __v) [inline, inherited] β€” left-shifts the array’s elements by the corresponding elements of v. Definition at line 1001 of file valarray.
  • template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator<<= (const _Tp & __t) [inline, inherited] β€” left-shifts every element e of the array by t bits. Definition at line 1001 of file valarray.
  • template<typename _Tp > void std::slice_array< _Tp >::operator= (const valarray< _Tp > & __v) const [inline, inherited] β€” assigns the slice elements to the corresponding elements of v. Definition at line 228 of file slice_array.h.
  • template<typename _Tp > void std::slice_array< _Tp >::operator= (const _Tp & __t) const [inline, inherited] β€” assigns every slice element to t. Definition at line 223 of file slice_array.h.
  • template<typename _Tp > slice_array< _Tp > & std::slice_array< _Tp >::operator= (const slice_array< _Tp > & __a) [inline, inherited] β€” assignment operator: assigns the slice elements to the corresponding elements of a. Refs: std::slice_array< _Tp >::_M_array, std::slice_array< _Tp >::_M_stride, and std::slice_array< _Tp >::_M_sz. Definition at line 214 of file slice_array.h.
  • template<typename _Tp > void std::mask_array< _Tp >::operator= (const _Tp & __t) const [inline, inherited] β€” assigns every slice element to t. Definition at line 157 of file mask_array.h.
  • template<typename _Tp > mask_array< _Tp > & std::mask_array< _Tp >::operator= (const mask_array< _Tp > & __a) [inline, inherited] β€” assignment operator: assigns the elements to the corresponding elements of a. Refs: std::mask_array< _Tp >::_M_array, and std::mask_array< _Tp >::_M_mask. Definition at line 148 of file mask_array.h.
  • template<typename _Tp > void std::indirect_array< _Tp >::operator= (const valarray< _Tp > & __v) const [inline, inherited] β€” assigns the slice elements to the corresponding elements of v. Definition at line 167 of file indirect_array.h.
  • template<typename _Tp > void std::indirect_array< _Tp >::operator= (const _Tp & __t) const [inline, inherited] β€” assigns every slice element to t. Definition at line 162 of file indirect_array.h.
  • template<typename _Tp > indirect_array< _Tp > & std::indirect_array< _Tp >::operator= (const indirect_array< _Tp > & __a) [inline, inherited] β€” assignment operator: assigns the elements to the corresponding elements of a. Refs: std::indirect_array< _Tp >::_M_array, and std::indirect_array< _Tp >::_M_index. Definition at line 153 of file indirect_array.h.
  • template<typename _Tp > void std::gslice_array< _Tp >::operator= (const valarray< _Tp > & __v) const [inline, inherited] β€” assigns the slice elements to the corresponding elements of v. Refs: std::valarray< _Tp >::size(). Definition at line 165 of file gslice_array.h.
  • template<typename _Tp > void std::gslice_array< _Tp >::operator= (const _Tp & __t) const [inline, inherited] β€” assigns every slice element to t. Refs: std::valarray< _Tp >::size(). Definition at line 157 of file gslice_array.h.
  • template<typename _Tp > gslice_array< _Tp > & std::gslice_array< _Tp >::operator= (const gslice_array< _Tp > & __a) [inline, inherited] β€” assignment operator: assigns the slice elements to the corresponding elements of a. Refs: std::gslice_array< _Tp >::_M_array, std::gslice_array< _Tp >::_M_index, and std::valarray< _Tp >::size(). Definition at line 147 of file gslice_array.h.
  • gslice & std::gslice::operator= (const gslice & __g) [inline, inherited] β€” assignment operator. Refs: std::gslice::_M_index. Definition at line 168 of file gslice.h.
  • template<typename _Tp> valarray< _Tp > & std::valarray< _Tp >::operator= (const indirect_array< _Tp > & __ia) [inline, inherited] β€” assigns elements to an array subset πŸ’…. It assigns the elements of the array to the values in ia. Results are undefined if ia does not have the same size as this array. Parameter: ia β€” array slice to get values from. Refs: std::indirect_array< _Tp >::_M_array, std::indirect_array< _Tp >::_M_index, and std::indirect_array< _Tp >::_M_sz. Definition at line 727 of file valarray.
  • template<typename _Tp> valarray< _Tp > & std::valarray< _Tp >::operator= (const mask_array< _Tp > & __ma) [inline, inherited] β€” assigns elements to an array subset ✨. It assigns the elements of the array to the values in ma. Results are undefined if ma does not have the same size as this array. Parameter: ma β€” array slice to get values from. Definition at line 717 of file valarray.

References: std::mask_array< _Tp >::_M_array, std::mask_array< _Tp >::_M_mask, and std::mask_array< _Tp >::_M_sz.


🫢 operator= from gslice_array β€” subset assignment, slay

template<typename _Tp> valarray< _Tp > & std::valarray< _Tp >::operator=(const gslice_array< _Tp > & __ga) [inline, inherited]

Assign elements to an array subset. Assign elements of array to values in ga.

Results are undefined if ga does not have the same size as this array. Do not skip the size check, bestie 😭

Parameters:

  • ga β€” Array slice to get values from.

Definition: line 707 of file valarray.

References: std::gslice_array< _Tp >::_M_array, std::gslice_array< _Tp >::_M_index, and std::valarray< _Tp >::size().


🌸 operator= from slice_array β€” assign the slice subset

template<typename _Tp> valarray< _Tp > & std::valarray< _Tp >::operator=(const slice_array< _Tp > & __sa) [inline, inherited]

Assign elements to an array subset. Assign elements of array to values in sa.

Results are undefined if sa does not have the same size as this array. Size mismatch = chaos, fr fr πŸ’€

Parameters:

  • sa β€” Array slice to get values from.

Definition: line 697 of file valarray.

References: std::slice_array< _Tp >::_M_array, std::slice_array< _Tp >::_M_stride, and std::slice_array< _Tp >::_M_sz.


πŸŽ€ operator= with a value β€” fill the whole vibe

template<typename _Tp> valarray< _Tp > & std::valarray< _Tp >::operator=(const _Tp & __t) [inline, inherited]

Assign elements to a value. Assign all elements of array to t. Every single one, no cap ✨

Parameters:

  • t β€” Value for elements.

Definition: line 689 of file valarray.


πŸ¦‹ operator= from initializer_list β€” list-to-array moment

template<typename _Tp> valarray< _Tp > & std::valarray< _Tp >::operator=(initializer_list< _Tp > __l) [inline, inherited]

Assign elements to an initializer_list. Assign elements of array to values in l.

Results are undefined if l does not have the same size as this array. Same-size check is the main character here 😭

Parameters:

  • l β€” initializer_list to get values from.

Definition: line 680 of file valarray.

References: std::initializer_list< _E >::begin(), and std::initializer_list< _E >::size().


πŸ’œ operator= from another valarray β€” copy the whole array

template<typename _Tp> valarray< _Tp > & std::valarray< _Tp >::operator=(const valarray< _Tp > & __v) [inline, inherited]

Assign elements to an array. Assign elements of array to values in v.

Results are undefined if v does not have the same size as this array. Please respect the size equality, bestie πŸ’…

Parameters:

  • v β€” Valarray to get values from.

Definition: line 670 of file valarray.

References: std::valarray< _Tp >::_M_data, and std::valarray< _Tp >::_M_size.


πŸŒ€ slice_array::operator>>= β€” right shift the slice

template<typename _Tp > void std::slice_array< _Tp >::operator>>= (const valarray< _Tp > & __v) const [inline, inherited]

Right shift slice elements by corresponding elements of v. Bit-shift energy, iconic 🫢

Definition: line 264 of file slice_array.h.


πŸŒ€ mask_array::operator>>= β€” right shift the masked subset

template<typename _Tp > void std::mask_array< _Tp >::operator>>= (const valarray< _Tp > & __v) const [inline, inherited]

Right shift slice elements by corresponding elements of v.

Definition: line 198 of file mask_array.h.


πŸŒ€ indirect_array::operator>>= β€” right shift the indirect subset

template<typename _Tp > void std::indirect_array< _Tp >::operator>>= (const valarray< _Tp > & __v) const [inline, inherited]

Right shift slice elements by corresponding elements of v.

Definition: line 202 of file indirect_array.h.


πŸŒ€ gslice_array::operator>>= β€” right shift the gslice subset

template<typename _Tp > void std::gslice_array< _Tp >::operator>>= (const valarray< _Tp > & __v) const [inline, inherited]

Right shift slice elements by corresponding elements of v.

Definition: line 208 of file gslice_array.h.


πŸ”₯ valarray::operator>>= with a valarray β€” right shift all the things

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator>>= (const valarray< _Tp > & __v) [inline, inherited]

Right shift elements of array by corresponding elements of v. Corresponding means matching, bestie β€” not random πŸ’…

Definition: line 1002 of file valarray.


πŸ”₯ valarray::operator>>= with a value β€” right shift by t bits

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator>>= (const _Tp & __t) [inline, inherited]

Right shift each element e of array by t bits.

Definition: line 1002 of file valarray.


πŸ¦‹ operator[] with a valarray< size_t > β€” reference a subset by index list

template<typename _Tp > indirect_array< _Tp > std::valarray< _Tp >::operator[] (const valarray< size_t > & __i) [inline, inherited]

Return a reference to an array subset.

Returns an indirect_array referencing the elements of the array indicated by the argument. The elements in the argument are interpreted as the indices of elements of this valarray to include in the subset. The returned indirect_array refers to these elements. Indirect but still direct enough, iykyk ✨

Parameters:

  • i β€” The valarray element index list.

Returns: Indirect_array referencing elements in i.

Definition: line 807 of file valarray.

References: std::valarray< _Tp >::size().


πŸ¦‹ operator[] with a valarray< size_t >, const β€” copy a subset by index list

template<typename _Tp > _Expr< _IClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::operator[] (const valarray< size_t > & __i) const [inline, inherited]

Return an array subset.

Returns a new valarray containing the elements of the array indicated by the argument. The elements in the argument are interpreted as the indices of elements of this valarray to copy to the return valarray. New array, who dis? πŸ’…

Parameters:

  • i β€” The valarray element index list.

Returns: New valarray containing elements in s.

Definition: line 799 of file valarray.


πŸŽ€ operator[] with a valarray< bool > β€” mask-array reference moment

template<typename _Tp > mask_array< _Tp > std::valarray< _Tp >::operator[] (const valarray< bool > & __m) [inline, inherited]

Return a reference to an array subset.

Returns a new mask_array referencing the elements of the array indicated by the argument. The input is a valarray of bool which represents a bitmask indicating which elements are part of the subset. Elements of the array are part of the subset if the corresponding element of the argument is true. Mask on, facts first πŸ‘‘

Parameters:

  • m β€” The valarray bitmask.

Returns: New valarray containing elements indicated by m.

Definition: line 788 of file valarray.

References: std::valarray< _Tp >::size().


πŸŽ€ operator[] with a valarray< bool >, const β€” copy the masked subset

template<typename _Tp > valarray< _Tp > std::valarray< _Tp >::operator[] (const valarray< bool > & __m) const [inline, inherited]

Return an array subset.

Returns a new valarray containing the elements of the array indicated by the argument. The input is a valarray of bool which represents a bitmask indicating which elements should be copied into the new valarray. Each element of the array is added to the return valarray if the corresponding element of the argument is true. True means invited, false means not on the list πŸ’…

Parameters:

  • m β€” The valarray bitmask.

Returns: New valarray containing elements indicated by m.

Definition: line 776 of file valarray.

References: std::valarray< _Tp >::size().


🌈 operator[] with a gslice β€” reference the gslice subset

template<typename _Tp > gslice_array< _Tp > std::valarray< _Tp >::operator[] (const gslice & __gs) [inline, inherited]

Return a reference to an array subset.

Returns a new valarray containing the elements of the array indicated by the gslice argument. The new valarray has the same size as the input gslice. Generalized slice said β€œI’ll take it from here” ✨

See also: gslice.

Parameters:

  • s β€” The source gslice.

Returns: New valarray containing elements in s.

Definition: line 768 of file valarray.

References: std::gslice::_M_index.


🌈 operator[] with a gslice, const β€” slice-array-ish subset

template<typename _Tp > _Expr< _GClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::operator[] (const gslice & __gs) const [inline, inherited]

Return an array subset.

Returns a slice_array referencing the elements of the array indicated by the slice argument.

See also: gslice.

Parameters:

  • s β€” The source slice.

Returns: Slice_array referencing elements indicated by s.

Definition: line 759 of file valarray.

References: std::gslice::_M_index.


πŸ“ operator[] with a slice β€” reference the slice subset

template<typename _Tp > slice_array< _Tp > std::valarray< _Tp >::operator[] (slice __s) [inline, inherited]

Return a reference to an array subset.

Returns a new valarray containing the elements of the array indicated by the slice argument. The new valarray has the same size as the input slice. Slice it, reference it, slay it πŸ’…

See also: slice.

Parameters:

  • s β€” The source slice.

Returns: New valarray containing elements in s.

Definition: line 754 of file valarray.


πŸ“ operator[] with a slice, const β€” copy the slice subset

template<typename _Tp > _Expr< _SClos< _ValArray, _Tp >, _Tp > std::valarray< _Tp >::operator[] (slice __s) const [inline, inherited]

Return an array subset.

Returns a new valarray containing the elements of the array indicated by the slice argument. The new valarray has the same size as the input slice.

See also: slice.

Parameters:

  • s β€” The source slice.

Returns: New valarray containing elements in s.

Definition: line 746 of file valarray.


⭐ operator[] with a size_t β€” the classic index reference

template<typename _Tp > _Tp & std::valarray< _Tp >::operator[] (size_t __i) [inline, inherited]

Return a reference to the i'th array element. Singular element, singular serve πŸ‘‘

Parameters:

  • i β€” Index of element to return.

Returns: Reference to the i'th element.

Definition: line 552 of file valarray.


🧚 slice_array::operator^= β€” logical xor the slice

template<typename _Tp > void std::slice_array< _Tp >::operator^= (const valarray< _Tp > & __v) const [inline, inherited]

Logical xor slice elements with corresponding elements of v. Exclusive-or said β€œnot both, bestie” ✨

Definition: line 260 of file slice_array.h.


🧚 mask_array::operator^= β€” logical xor the masked subset

template<typename _Tp > void std::mask_array< _Tp >::operator^= (const valarray< _Tp > & __v) const [inline, inherited]

Logical xor slice elements with corresponding elements of v.

Definition: line 194 of file mask_array.h.


🧚 indirect_array::operator^= β€” logical xor the indirect subset

template<typename _Tp > void std::indirect_array< _Tp >::operator^= (const valarray< _Tp > & __v) const [inline, inherited]

Logical xor slice elements with corresponding elements of v.

Definition: line 198 of file indirect_array.h.


🧚 gslice_array::operator^= β€” logical xor the gslice subset

template<typename _Tp > void std::gslice_array< _Tp >::operator^= (const valarray< _Tp > & __v) const [inline, inherited]

Logical xor slice elements with corresponding elements of v.

Definition: line 204 of file gslice_array.h.


πŸ‘‘ valarray::operator^= with a valarray β€” xor all the corresponding elements

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator^= (const valarray< _Tp > & __v) [inline, inherited]

Logical xor corresponding elements of v with elements of array. One-to-one xor correspondence, no cap πŸ’…

Definition: line 998 of file valarray.


πŸ‘‘ valarray::operator^= with a value β€” xor every element

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator^= (const _Tp & __t) [inline, inherited]

Set each element e of array to e ^ t.

Definition: line 998 of file valarray.


🌸 slice_array::operator|= β€” logical or the slice

template<typename _Tp > void std::slice_array< _Tp >::operator|= (const valarray< _Tp > & __v) const [inline, inherited]

Logical or slice elements with corresponding elements of v. Or means either one can carry the vibe 🫢

Definition: line 262 of file slice_array.h.


🌸 mask_array::operator|= β€” logical or the masked subset

template<typename _Tp > void std::mask_array< _Tp >::operator|= (const valarray< _Tp > & __v) const [inline, inherited]

Logical or slice elements with corresponding elements of v.

Definition: line 196 of file mask_array.h.


🌸 indirect_array::operator|= β€” logical or the indirect subset

template<typename _Tp > void std::indirect_array< _Tp >::operator|= (const valarray< _Tp > & __v) const [inline, inherited]

Logical or slice elements with corresponding elements of v.

Definition: line 200 of file indirect_array.h.


🌸 gslice_array::operator|= β€” logical or the gslice subset

template<typename _Tp > void std::gslice_array< _Tp >::operator|= (const valarray< _Tp > & __v) const [inline, inherited]

Logical or slice elements with corresponding elements of v.

Definition: line 206 of file gslice_array.h.

🧑 operator|= β€” the valarray version

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator|=
    (const valarray< _Tp > & __v) [inline, inherited]

okay so this one does a logical or of corresponding elements of v with elements of array. slay. Definition at line 1000 of file valarray.

🧑 operator|= β€” the _Tp version

template<class _Tp> valarray< _Tp > & std::valarray< _Tp >::operator|=
    (const _Tp & __t) [inline, inherited]

Set each element e of array to e | t. periodt. Definition at line 1000 of file valarray.

🌸 operator~

template<typename _Tp > valarray< _Tp >::template _UnaryOp< __bitwise_not
    >::_Rt std::valarray< _Tp >::operator~ () const [inline, inherited]

Return a new valarray by applying unary ~ to each element. cute little bit-flipper. Definition at line 969 of file valarray.

πŸŽ€ resize

template<class _Tp> void std::valarray< _Tp >::resize (size_t __size, _Tp
    __c = _Tp()) [inline, inherited]

Resize array.

Resize this array to size and set all elements to c. All references and iterators are invalidated. bestie, that part matters 😭

Parameters:

  • size β€” New array size.
  • c β€” New value for all elements.

Definition at line 910 of file valarray.

πŸ¦‹ shift

template<class _Tp > valarray< _Tp > std::valarray< _Tp >::shift (int __n)
    const [inline, inherited]

Return a shifted array.

A new valarray is constructed as a copy of this array with elements in shifted positions. For an element with index i, the new position is i - n. The new valarray has the same size as the current one. New elements without a value are set to 0. Elements whose new position is outside the bounds of the array are discarded.

Positive arguments shift toward index 0, discarding elements [0, n). Negative arguments discard elements from the top of the array.

Parameters:

  • n β€” Number of element positions to shift.

Returns:

  • New valarray with elements in shifted positions.

Definition at line 828 of file valarray.

References std::valarray< _Tp >::_M_data, and std::valarray< _Tp >::_M_size.

πŸ’œ slice::size

size_t std::slice::size () const [inline, inherited]

Return size of slice. Definition at line 101 of file slice_array.h.

πŸ’œ gslice::size

valarray< size_t > std::gslice::size () const [inline, inherited]

Return array of sizes of slice dimensions. Definition at line 137 of file gslice.h.

πŸ’œ valarray::size

template<class _Tp > size_t std::valarray< _Tp >::size () const [inline,
    inherited]

Return the number of elements in array. Definition at line 815 of file valarray.

Referenced by std::valarray< _Tp >::operator=(), std::gslice_array< _Tp >::operator=(), and std::valarray< _Tp >::operator[]().

πŸ“ slice::slice β€” the big constructor

std::slice::slice (size_t __o, size_t __d, size_t __s) [inline, inherited]

Construct a slice.

Parameters:

  • o β€” Offset in array of first element.
  • d β€” Number of elements in slice.
  • s β€” Stride between array elements.

Definition at line 93 of file slice_array.h.

πŸ“ slice::slice β€” the empty one

std::slice::slice () [inline, inherited]

Construct an empty slice. Definition at line 89 of file slice_array.h.

🌈 slice_array::slice_array β€” copy constructor

template<typename _Tp > std::slice_array< _Tp >::slice_array (const
    slice_array< _Tp > & a) [inline, inherited]

Copy constructor. Both slices refer to the same underlying array. Definition at line 206 of file slice_array.h.

⭐ slice::start

size_t std::slice::start () const [inline, inherited]

Return array offset of first slice element. Definition at line 97 of file slice_array.h.

⭐ gslice::start

size_t std::gslice::start () const [inline, inherited]

Return array offset of first slice element. Definition at line 133 of file gslice.h.

⭐ slice::stride

size_t std::slice::stride () const [inline, inherited]

Return array stride of slice. Definition at line 105 of file slice_array.h.

⭐ gslice::stride

valarray< size_t > std::gslice::stride () const [inline, inherited]

Return array of array strides for each dimension. Definition at line 141 of file gslice.h.

πŸ”₯ sum

template<class _Tp > _Tp std::valarray< _Tp >::sum () const [inline,
    inherited]

Return the sum of all elements in the array.

Accumulates the sum of all elements into a Tp using +=. The order of adding the elements is unspecified. no cap, that’s the whole note. Definition at line 820 of file valarray.

🧚 valarray β€” initializer_list constructor

template<typename _Tp> std::valarray< _Tp >::valarray (initializer_list< _Tp
    > __l) [inline, inherited]

Construct an array with an initializer_list of values. Definition at line 649 of file valarray.

References std::initializer_list< _E >::begin(), and std::initializer_list< _E >::end().

🧚 valarray β€” indirect_array constructor

template<typename _Tp> std::valarray< _Tp >::valarray (const indirect_array<
    _Tp > & __ia) [inline, inherited]

Construct an array with the same size and values in ia. Definition at line 639 of file valarray.

References std::indirect_array< _Tp >::_M_array, and std::indirect_array< _Tp >::_M_index.

🧚 valarray β€” mask_array constructor

template<typename _Tp> std::valarray< _Tp >::valarray (const mask_array< _Tp
    > & __ma) [inline, inherited]

Construct an array with the same size and values in ma. Definition at line 630 of file valarray.

References std::mask_array< _Tp >::_M_array, and std::mask_array< _Tp >::_M_mask.

🧚 valarray β€” gslice_array constructor

template<typename _Tp> std::valarray< _Tp >::valarray (const gslice_array<
    _Tp > & __ga) [inline, inherited]

Construct an array with the same size and values in ga. Definition at line 619 of file valarray.

References std::gslice_array< _Tp >::_M_array, and std::gslice_array< _Tp >::_M_index.

🧚 valarray β€” slice_array constructor

template<typename _Tp> std::valarray< _Tp >::valarray (const slice_array<
    _Tp > & __sa) [inline, inherited]

Construct an array with the same size and values in sa. Definition at line 610 of file valarray.

References std::slice_array< _Tp >::_M_array, std::slice_array< _Tp >::_M_stride, and std::slice_array< _Tp >::_M_sz.

🧚 valarray β€” copy constructor

template<typename _Tp> std::valarray< _Tp >::valarray (const valarray< _Tp >
    & __v) [inline, inherited]

Copy constructor. Definition at line 603 of file valarray.

References std::valarray< _Tp >::_M_data.

🧚 valarray β€” fill constructor

template<typename _Tp> std::valarray< _Tp >::valarray (const _Tp & __t,
    size_t __n) [inline, inherited]

Construct an array with n elements initialized to t. Definition at line 588 of file valarray.

🧚 valarray β€” size constructor

template<typename _Tp > std::valarray< _Tp >::valarray (size_t __n) [inline,
    explicit, inherited]

Construct an array with n elements. Definition at line 582 of file valarray.

🧚 valarray β€” default constructor

template<typename _Tp > std::valarray< _Tp >::valarray () [inline,
    inherited]

Construct an empty array. Definition at line 578 of file valarray.

πŸ’€ gslice::~gslice

std::gslice::~gslice () [inline, inherited]

Destructor. Definition at line 161 of file gslice.h.


πŸ‘‘ AUTHOR

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


okay bestie, that’s the whole page β€” source/version libstdc++, date 21 Apr 2009, and it’s the Numeric Arrays(3) manpage. go off πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from