STD::GSLICE_ARRAY(3cxx)
π«Ά std::gslice_array< _Tp > π«Ά
Okay bestie, welcome to the std::gslice_array< _Tp > page from the 3cxx manual β yes, that 3cxx. This whole page is about a very specific little reference-to-a-multi-dimensional-subset situation, and we're gonna keep every detail while making it actually fun to read. π
πΈ NAME πΈ
std::gslice_array< _Tp > β reference to a multi-dimensional subset of an array. That's the whole name-and-blurb combo, and it ate. β¨
β¨ SYNOPSIS β¨
#include <valarray>
π Public Types π
typedef _Tp value_typeβ the element type gets its cute alias moment. π¦
π Public Member Functions π
gslice_array (const gslice_array &)β copy constructor, and no cap: both slices refer to the same underlying array. Both of them. Same array. Iconic shared-reference behavior. π«template<class _Dom > void operator%= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of modulo assignment, exactly as listed here with no extra one-liner on the page. πvoid operator%= (const valarray< _Tp > &) constβ modulo slice elements by corresponding elements ofv.template<class _Dom > void operator&= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of logical-and assignment.void operator&= (const valarray< _Tp > &) constβ logical and slice elements with corresponding elements ofv.template<class _Dom > void operator*= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of multiply-assignment.void operator*= (const valarray< _Tp > &) constβ multiply slice elements by corresponding elements ofv.template<class _Dom > void operator+= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of add-assignment.void operator+= (const valarray< _Tp > &) constβ add corresponding elements ofvto slice elements.template<class _Dom > void operator-= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of subtract-assignment.void operator-= (const valarray< _Tp > &) constβ subtract corresponding elements ofvfrom slice elements.template<class _Dom > void operator/= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of divide-assignment.void operator/= (const valarray< _Tp > &) constβ divide slice elements by corresponding elements ofv.template<class _Dom > void operator<<= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of left-shift assignment.void operator<<= (const valarray< _Tp > &) constβ left shift slice elements by corresponding elements ofv.template<class _Dom > void operator= (const _Expr< _Dom, _Tp > &) constβ the_Exprassignment overload, sitting right here with no separate description on the page.void operator= (const _Tp &) constβ assign all slice elements tot.gslice_array & operator= (const gslice_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 > &) constβ the_Exproverload of right-shift assignment.void operator>>= (const valarray< _Tp > &) constβ right shift slice elements by corresponding elements ofv.template<class _Dom > void operator^= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of logical-xor assignment.void operator^= (const valarray< _Tp > &) constβ logical xor slice elements with corresponding elements ofv.template<class _Dom > void operator|= (const _Expr< _Dom, _Tp > &) constβ the_Exproverload of logical-or assignment.void operator|= (const valarray< _Tp > &) constβ logical or slice elements with corresponding elements ofv.
π«Ά Friends π«Ά
class valarray< _Tp >β friendship status: confirmed.valarrayis a friend of this class. π₯Ή
π Detailed Description π
template<typename _Tp>
class std::gslice_array< _Tp >
A gslice_array is a reference to the actual elements of an array specified by a gslice. That's the whole main-character setup: it doesn't own a whole new copy of the world, it refers to the real elements in the original array. π
The way to get a gslice_array is to call operator[](gslice) on a valarray. The returned gslice_array then permits carrying operations out on the referenced subset of elements in the original valarray. So you're not doing random busywork on a clone β you're working on the referenced subset. For example, operator+=(valarray) will add values to the subset of elements in the underlying valarray this gslice_array refers to. Slay, but make it element-wise. π
πΈ Parameters πΈ
Tpβ element type.
π₯ Member Function Documentation π₯
template<typename _Tp > void std::gslice_array< _Tp >::operator%= (const valarray< _Tp > &) constβ modulo slice elements by corresponding elements ofv.template<typename _Tp > void std::gslice_array< _Tp >::operator&= (const valarray< _Tp > &) constβ logical and slice elements with corresponding elements ofv.template<typename _Tp > void std::gslice_array< _Tp >::operator*= (const valarray< _Tp > &) constβ multiply slice elements by corresponding elements ofv.template<typename _Tp > void std::gslice_array< _Tp >::operator+= (const valarray< _Tp > &) constβ add corresponding elements ofvto slice elements.template<typename _Tp > void std::gslice_array< _Tp >::operator-= (const valarray< _Tp > &) constβ subtract corresponding elements ofvfrom slice elements.template<typename _Tp > void std::gslice_array< _Tp >::operator/= (const valarray< _Tp > &) constβ divide slice elements by corresponding elements ofv.template<typename _Tp > void std::gslice_array< _Tp >::operator<<= (const valarray< _Tp > &) constβ left shift slice elements by corresponding elements ofv.template<typename _Tp > void std::gslice_array< _Tp >::operator>>= (const valarray< _Tp > &) constβ right shift slice elements by corresponding elements ofv.template<typename _Tp > void std::gslice_array< _Tp >::operator^= (const valarray< _Tp > &) constβ logical xor slice elements with corresponding elements ofv.template<typename _Tp > void std::gslice_array< _Tp >::operator|= (const valarray< _Tp > &) constβ logical or slice elements with corresponding elements ofv.
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. Very βthe robot wrote it so you don't have toβ energy. π€β¨
Source/version: libstdc++ β this page is from the 3cxx manual section. Date: the page itself doesn't print one, so no date to quote, and we're not out here inventing facts. It's giving timeless. Bye bestie, go slice that multi-dimensional subset responsibly π
ππ«Ά
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms