STD::GSLICE_ARRAY(3)
π std::gslice_array< _Tp > β Library Functions Manual (section 3, bestie) π
okay so. this is a page from the Library Functions Manual, section 3, and it's all about std::gslice_array< _Tp >. it's a C++ thing. it's giving "i'm a reference and i know it". let's go π¦
β¨ NAME β¨
std::gslice_array< _Tp > β a reference to a multi-dimensional subset of an array. that's it. that's the whole job. iconic behavior honestly π
πΈ SYNOPSIS πΈ
first things first, you gotta let it in:
#include <valarray>
π Public Types π
typedef _Tp value_typeβ yeah. the value type is_Tp. it said what it said π
π«Ά Public Member Functions π«Ά
gslice_array (const gslice_array &)β copy constructor, bestie. both slices end up referring to the same underlying array. no cap, they're literally sharing. don't be weird about it.template<class _Dom> void operator%= (const _Expr< _Dom, _Tp > &) constvoid operator%= (const valarray< _Tp > &) constβ modulo the slice elements by the corresponding elements of v. math girl summer β¨template<class _Dom> void operator&= (const _Expr< _Dom, _Tp > &) constvoid operator&= (const valarray< _Tp > &) constβ logical and the slice elements with the corresponding elements of v.template<class _Dom> void operator*= (const _Expr< _Dom, _Tp > &) constvoid operator*= (const valarray< _Tp > &) constβ multiply the slice elements by the corresponding elements of v.template<class _Dom> void operator+= (const _Expr< _Dom, _Tp > &) constvoid operator+= (const valarray< _Tp > &) constβ add the corresponding elements of v to the slice elements.template<class _Dom> void operator-= (const _Expr< _Dom, _Tp > &) constvoid operator-= (const valarray< _Tp > &) constβ subtract the corresponding elements of v from the slice elements.template<class _Dom> void operator/= (const _Expr< _Dom, _Tp > &) constvoid operator/= (const valarray< _Tp > &) constβ divide the slice elements by the corresponding elements of v.template<class _Dom> void operator<<= (const _Expr< _Dom, _Tp > &) constvoid operator<<= (const valarray< _Tp > &) constβ left shift the slice elements by the corresponding elements of v.template<class _Dom> void operator= (const _Expr< _Dom, _Tp > &) constvoid operator= (const _Tp &) constβ assign all the slice elements to t. all of them. every single one. periodt.gslice_array & operator= (const gslice_array &)β assignment operator π« it assigns the slice elements to the corresponding elements of a.void operator= (const valarray< _Tp > &) constβ assign the slice elements to the corresponding elements of v.template<class _Dom> void operator>>= (const _Expr< _Dom, _Tp > &) constvoid operator>>= (const valarray< _Tp > &) constβ right shift the slice elements by the corresponding elements of v.template<class _Dom> void operator^= (const _Expr< _Dom, _Tp > &) constvoid operator^= (const valarray< _Tp > &) constβ logical xor the slice elements with the corresponding elements of v.template<class _Dom> void operator|= (const _Expr< _Dom, _Tp > &) constvoid operator|= (const valarray< _Tp > &) constβ logical or the slice elements with the corresponding elements of v.
π Friends π
class valarray< _Tp >β yeah they're friends. mutuals. π€
π₯ Detailed Description π₯
template<typename _Tp>
class std::gslice_array< _Tp >
"Reference to multi-dimensional subset of an array."
so here's the tea β a gslice_array is a reference to the actual elements of an array that got specified by a gslice. the way you get one is by calling operator[](gslice) on a valarray. and then?? the gslice_array you get back lets you carry operations out on the referenced subset of elements in the original valarray. like for example, operator+=(valarray) will add values to the subset of elements in the underlying valarray that this gslice_array refers to. it's literally reaching into the original array and doing stuff. main character energy fr fr π₯
π Parameters π
- Tp β element type. that's it. that's the parameter. π
π Member Function Documentation π
template<typename _Tp> void std::gslice_array< _Tp >::operator%= (const valarray< _Tp > & ) constβ modulo slice elements by corresponding elements of v.template<typename _Tp> void std::gslice_array< _Tp >::operator&= (const valarray< _Tp > & ) constβ logical and slice elements with corresponding elements of v.template<typename _Tp> void std::gslice_array< _Tp >::operator*= (const valarray< _Tp > & ) constβ multiply slice elements by corresponding elements of v.template<typename _Tp> void std::gslice_array< _Tp >::operator+= (const valarray< _Tp > & ) constβ add corresponding elements of v to slice elements.template<typename _Tp> void std::gslice_array< _Tp >::operator-= (const valarray< _Tp > & ) constβ subtract corresponding elements of v from slice elements.template<typename _Tp> void std::gslice_array< _Tp >::operator/= (const valarray< _Tp > & ) constβ divide slice elements by corresponding elements of v.template<typename _Tp> void std::gslice_array< _Tp >::operator<<= (const valarray< _Tp > & ) constβ left shift slice elements by corresponding elements of v.template<typename _Tp> void std::gslice_array< _Tp >::operator>>= (const valarray< _Tp > & ) constβ right shift slice elements by corresponding elements of v.template<typename _Tp> void std::gslice_array< _Tp >::operator^= (const valarray< _Tp > & ) constβ logical xor slice elements with corresponding elements of v.template<typename _Tp> void std::gslice_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. so likeβ¦ a robot wrote this, not me, i just did the glow-up π
and that's the whole page, bestie π«Ά shoutout to libstdc++ for the source and version, and to Doxygen for generating it β std::gslice_array< _Tp >(3) out. slay, stay safe, and remember: it's a reference, not a copy. πβ¨ππ¦πΈ
π¦ 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