mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #3743 from ethereum/popStorageArray
pop() for storage arrays
This commit is contained in:
+3
-1
@@ -682,7 +682,7 @@ possible:
|
||||
It is planned to remove this restriction in the future but currently creates
|
||||
some complications because of how arrays are passed in the ABI.
|
||||
|
||||
.. index:: ! array;length, length, push, !array;push
|
||||
.. index:: ! array;length, length, push, pop, !array;push, !array;pop
|
||||
|
||||
Members
|
||||
^^^^^^^
|
||||
@@ -693,6 +693,8 @@ Members
|
||||
``.length`` member. This does not happen automatically when attempting to access elements outside the current length. The size of memory arrays is fixed (but dynamic, i.e. it can depend on runtime parameters) once they are created.
|
||||
**push**:
|
||||
Dynamic storage arrays and ``bytes`` (not ``string``) have a member function called ``push`` that can be used to append an element at the end of the array. The function returns the new length.
|
||||
**pop**:
|
||||
Dynamic storage arrays and ``bytes`` (not ``string``) have a member function called ``pop`` that can be used to remove an element from the end of the array.
|
||||
|
||||
.. warning::
|
||||
It is not yet possible to use arrays of arrays in external functions.
|
||||
|
||||
Reference in New Issue
Block a user