STD::INDIRECT_ARRAY(3)
β¨ std::indirect_array< _Tp > β¨
okay bestie, welcome to the Library Functions Manual entry for std::indirect_array< _Tp > π no cap, this is a whole vibe.
πΈ NAME πΈ
std::indirect_array< _Tp > β Reference to arbitrary subset of an array.
π SYNOPSIS π
#include <valarray>
π Public Types
typedef _Tp value_type
π¦ Public Member Functions
indirect_array (const indirect_array &)β Copy constructor. Both slices refer to the same underlying array. (yes, same underlying array, they're literally sharing, it's giving twins π―)template<class _Dom> void operator%= (const _Expr< _Dom, _Tp > &) constvoid operator%= (const valarray< _Tp > &) constβ Modulo slice elements by corresponding elements of v.template<class _Dom> void operator&= (const _Expr< _Dom, _Tp > &) constvoid operator&= (const valarray< _Tp > &) constβ Logical and slice elements with corresponding elements of v.template<class _Dom> void operator*= (const _Expr< _Dom, _Tp > &) constvoid operator*= (const valarray< _Tp > &) constβ Multiply slice elements by corresponding elements of v.template<class _Dom> void operator+= (const _Expr< _Dom, _Tp > &) constvoid operator+= (const valarray< _Tp > &) constβ Add corresponding elements of v to slice elements.template<class _Dom> void operator-= (const _Expr< _Dom, _Tp > &) constvoid operator-= (const valarray< _Tp > &) constβ Subtract corresponding elements of v from slice elements.template<class _Dom> void operator/= (const _Expr< _Dom, _Tp > &) constvoid operator/= (const valarray< _Tp > &) constβ Divide slice elements by corresponding elements of v.template<class _Dom> void operator<<= (const _Expr< _Dom, _Tp > &) constvoid operator<<= (const valarray< _Tp > &) constβ Left shift slice elements by corresponding elements of v.template<class _Dom> void operator= (const _Expr< _Dom, _Tp > &) constvoid operator= (const _Tp &) constβ Assign all slice elements to t.indirect_array & operator= (const indirect_array &)β Assignment operator. Assigns 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 > &) constvoid operator>>= (const valarray< _Tp > &) constβ Right shift slice elements by corresponding elements of v.template<class _Dom> void operator^= (const _Expr< _Dom, _Tp > &) constvoid operator^= (const valarray< _Tp > &) constβ Logical xor slice elements with corresponding elements of v.template<class _Dom> void operator|= (const _Expr< _Dom, _Tp > &) constvoid operator|= (const valarray< _Tp > &) constβ Logical or slice elements with corresponding elements of v.
π Friends
class gslice_array< _Tp >class valarray< _Tp >
π Detailed Description π
template<class _Tp>
class std::indirect_array< _Tp >
Reference to arbitrary subset of an array.
ok so picture this π«Ά β an indirect_array is a reference to the actual elements of an array, and which elements it points at is decided by an ordered array of indices. It's not a copy, bestie, it's a little window into the real thing.
The way to get an indirect_array is to call operator[](valarray<size_t>) on a valarray. The returned indirect_array then permits carrying operations out on the referenced subset of elements in the original valarray. So you grab your lil slice, you do your math, and the original array is the one that actually changed. main character energy, honestly β¨
For example, if an indirect_array is obtained using the array (4,2,0) as an argument, and then assigned to an array containing (1,2,3), then the underlying array will have array[0]==3, array[2]==2, and array[4]==1. the way that index 0 gets the THIRD valueβ¦ yeah it's flipped, that's the whole point, it's indexed by the index list π
π§ Parameters
Tpβ Element type.
β Member Function Documentation β
template<class _Tp> void std::indirect_array< _Tp >::operator%= (const valarray< _Tp > & ) const
Modulo slice elements by corresponding elements of v. π
template<class _Tp> void std::indirect_array< _Tp >::operator&= (const valarray< _Tp > & ) const
Logical and slice elements with corresponding elements of v.
template<class _Tp> void std::indirect_array< _Tp >::operator*= (const valarray< _Tp > & ) const
Multiply slice elements by corresponding elements of v.
template<class _Tp> void std::indirect_array< _Tp >::operator+= (const valarray< _Tp > & ) const
Add corresponding elements of v to slice elements.
template<class _Tp> void std::indirect_array< _Tp >::operator-= (const valarray< _Tp > & ) const
Subtract corresponding elements of v from slice elements.
template<class _Tp> void std::indirect_array< _Tp >::operator/= (const valarray< _Tp > & ) const
Divide slice elements by corresponding elements of v.
template<class _Tp> void std::indirect_array< _Tp >::operator<<= (const valarray< _Tp > & ) const
Left shift slice elements by corresponding elements of v.
template<class _Tp> void std::indirect_array< _Tp >::operator>>= (const valarray< _Tp > & ) const
Right shift slice elements by corresponding elements of v.
template<class _Tp> void std::indirect_array< _Tp >::operator^= (const valarray< _Tp > & ) const
Logical xor slice elements with corresponding elements of v.
template<class _Tp> void std::indirect_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.
and that's the whole page, bestie π₯° this one's from libstdc++, and it's filed in the manual as std::indir...ray< _Tp >(3) β go forth and slice, ily, bye πβ¨π¦
π¦ 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