mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0030143: Foundation Classes - provide operator[] alias for NCollection_Array1, NCollection_Vector
This commit is contained in:
@@ -348,6 +348,9 @@ public:
|
||||
const TheItemType& operator() (const Standard_Integer theIndex) const
|
||||
{ return Value (theIndex); }
|
||||
|
||||
//! operator[] - alias to Value
|
||||
const TheItemType& operator[] (Standard_Integer theIndex) const { return Value (theIndex); }
|
||||
|
||||
//! Variable value access
|
||||
TheItemType& ChangeValue (const Standard_Integer theIndex)
|
||||
{
|
||||
@@ -359,6 +362,9 @@ public:
|
||||
TheItemType& operator() (const Standard_Integer theIndex)
|
||||
{ return ChangeValue (theIndex); }
|
||||
|
||||
//! operator[] - alias to ChangeValue
|
||||
TheItemType& operator[] (Standard_Integer theIndex) { return ChangeValue (theIndex); }
|
||||
|
||||
//! Set value
|
||||
void SetValue (const Standard_Integer theIndex,
|
||||
const TheItemType& theItem)
|
||||
|
@@ -231,6 +231,9 @@ public: //! @name public methods
|
||||
return Value (theIndex);
|
||||
}
|
||||
|
||||
//! Operator[] - query the const value
|
||||
const TheItemType& operator[] (Standard_Integer theIndex) const { return Value (theIndex); }
|
||||
|
||||
const TheItemType& Value (const Standard_Integer theIndex) const
|
||||
{
|
||||
return *(const TheItemType* )findV (theIndex);
|
||||
@@ -266,6 +269,9 @@ public: //! @name public methods
|
||||
return ChangeValue (theIndex);
|
||||
}
|
||||
|
||||
//! Operator[] - query the value
|
||||
TheItemType& operator[] ( Standard_Integer theIndex) { return ChangeValue (theIndex); }
|
||||
|
||||
TheItemType& ChangeValue (const Standard_Integer theIndex)
|
||||
{
|
||||
return *(TheItemType* )findV (theIndex);
|
||||
|
Reference in New Issue
Block a user