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 > &) constvoid operator%= (const valarray< _Tp > &) constβ Modulo slice elements by corresponding elements ofv. π₯template<class _Dom> void operator&= (const _Expr< _Dom, _Tp > &) constvoid operator&= (const valarray< _Tp > &) constβ Logical and slice elements with corresponding elements ofv. β¨template<class _Dom> void operator*= (const _Expr< _Dom, _Tp > &) constvoid operator*= (const valarray< _Tp > &) constβ Multiply slice elements by corresponding elements ofv. πtemplate<class _Dom> void operator+= (const _Expr< _Dom, _Tp > &) constvoid operator+= (const valarray< _Tp > &) constβ Add corresponding elements ofvto slice elements. βtemplate<class _Dom> void operator-= (const _Expr< _Dom, _Tp > &) constvoid operator-= (const valarray< _Tp > &) constβ Subtract corresponding elements ofvfrom slice elements. βtemplate<class _Dom> void operator/= (const _Expr< _Dom, _Tp > &) constvoid operator/= (const valarray< _Tp > &) constβ Divide slice elements by corresponding elements ofv. πtemplate<class _Dom> void operator<<= (const _Expr< _Dom, _Tp > &) constvoid operator<<= (const valarray< _Tp > &) constβ Left shift slice elements by corresponding elements ofv. βtemplate<class _Dom> void operator= (const _Expr< _Dom, _Tp > &) constvoid operator= (const _Tp &) constβ Assign all slice elements tot. πslice_array & operator= (const slice_array &)β Assignment operator. Assigns slice elements to corresponding elements ofa. πvoid operator= (const valarray< _Tp > &) constβ Assign slice elements to corresponding elements ofv. πtemplate<class _Dom> void operator>>= (const _Expr< _Dom, _Tp > &) constvoid operator>>= (const valarray< _Tp > &) constβ Right shift slice elements by corresponding elements ofv. πtemplate<class _Dom> void operator^= (const _Expr< _Dom, _Tp > &) constvoid operator^= (const valarray< _Tp > &) constβ Logical xor slice elements with corresponding elements ofv. πtemplate<class _Dom> void operator|= (const _Expr< _Dom, _Tp > &) constvoid operator|= (const valarray< _Tp > &) constβ Logical or slice elements with corresponding elements ofv. πΈ
π§ 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 thelibstdc++manual, section3(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