STD::SLICE_ARRAY(3)

πŸ’– NAME πŸ’–

std::slice_array< _Tp > β€” bestie, it's a reference to a one-dimensional subset of an array. That's it, that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

#include <valarray>

🌸 Public Types 🌸

  • typedef _Tp value_type β€” the element type, keeping it cute and generic πŸ’…

πŸ¦‹ Public Member Functions πŸ¦‹

  • slice_array (const slice_array &) β€” copy constructor. Both slices refer to the same underlying array. no cap, they're literally sharing 🫢
  • 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
  • void operator= (const _Tp &) const β€” Assign all slice elements to t. πŸ‘‘
  • slice_array & operator= (const slice_array &) β€” Assignment operator. Assigns slice elements to corresponding elements of a. πŸ’œ
  • void operator= (const valarray< _Tp > &) const β€” Assign slice elements to corresponding elements of v. 🌈
  • 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 > β€” yeah they're besties, it's giving mutuals ✨

πŸ’… Detailed Description πŸ’…

template<typename _Tp>
    class std::slice_array< _Tp >

"Reference to one-dimensional subset of an array." 🫢

A slice_array is a reference to the actual elements of an array specified by a slice. The way to get a slice_array is to call operator[](slice) on a valarray. The returned slice_array then permits carrying operations out on the referenced subset of elements in the original valarray. For example, operator+=(valarray) will add values to the subset of elements in the underlying valarray this slice_array refers to.

Like… it's not a copy, bestie. It's a situationship with the original array. It points at the real ones. πŸ‘€

Parameters

  • Tp β€” Element type.

πŸ”₯ Member Function Documentation πŸ”₯

template<typename _Tp> void std::slice_array< _Tp >::operator%= (const valarray< _Tp > & ) const

Modulo slice elements by corresponding elements of v.


template<typename _Tp> void std::slice_array< _Tp >::operator&= (const valarray< _Tp > & ) const

Logical and slice elements with corresponding elements of v.


template<typename _Tp> void std::slice_array< _Tp >::operator*= (const valarray< _Tp > & ) const

Multiply slice elements by corresponding elements of v.


template<typename _Tp> void std::slice_array< _Tp >::operator+= (const valarray< _Tp > & ) const

Add corresponding elements of v to slice elements.


template<typename _Tp> void std::slice_array< _Tp >::operator-= (const valarray< _Tp > & ) const

Subtract corresponding elements of v from slice elements.


template<typename _Tp> void std::slice_array< _Tp >::operator/= (const valarray< _Tp > & ) const

Divide slice elements by corresponding elements of v.


template<typename _Tp> void std::slice_array< _Tp >::operator<<= (const valarray< _Tp > & ) const

Left shift slice elements by corresponding elements of v.


template<typename _Tp> void std::slice_array< _Tp >::operator>>= (const valarray< _Tp > & ) const

Right shift slice elements by corresponding elements of v.


template<typename _Tp> void std::slice_array< _Tp >::operator^= (const valarray< _Tp > & ) const

Logical xor slice elements with corresponding elements of v.


template<typename _Tp> void std::slice_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. Not me writing it by hand, the robots did that part πŸ€–βœ¨


okay bestie that's the whole page πŸ’– this one lives in the libstdc++ manual, section 3 (library functions, iykyk), and yes β€” Doxygen generated the whole thing straight from the source code. go forth and slice, you main character πŸ‘‘πŸ¦‹
πŸ“¦ 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