mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix reference links in types.rst
This commit is contained in:
parent
2a2cea08dd
commit
27fd533f3d
@ -7,6 +7,8 @@ If ``a`` is an LValue (i.e. a variable or something that can be assigned to), th
|
||||
|
||||
``a += e`` is equivalent to ``a = a + e``. The operators ``-=``, ``*=``, ``/=``, ``%=``, ``|=``, ``&=`` and ``^=`` are defined accordingly. ``a++`` and ``a--`` are equivalent to ``a += 1`` / ``a -= 1`` but the expression itself still has the previous value of ``a``. In contrast, ``--a`` and ``++a`` have the same effect on ``a`` but return the value after the change.
|
||||
|
||||
.. _delete:
|
||||
|
||||
delete
|
||||
------
|
||||
|
||||
|
@ -217,13 +217,13 @@ Array Members
|
||||
For dynamically-sized arrays (only available for storage), this member can be assigned to resize the array.
|
||||
Accessing elements outside the current length does not automatically resize the array and instead causes a failing assertion.
|
||||
Increasing the length adds new zero-initialised elements to the array.
|
||||
Reducing the length performs an implicit :ref:``delete`` on each of the
|
||||
Reducing the length performs an implicit :ref:`delete<delete>` on each of the
|
||||
removed elements. If you try to resize a non-dynamic array that isn't in
|
||||
storage, you receive a ``Value must be an lvalue`` error.
|
||||
**push**:
|
||||
Dynamic storage arrays and ``bytes`` (not ``string``) have a member function called ``push`` that you can use to append an element at the end of the array. The element will be zero-initialised. The function returns the new length.
|
||||
**pop**:
|
||||
Dynamic storage arrays and ``bytes`` (not ``string``) have a member function called ``pop`` that you can use to remove an element from the end of the array. This also implicitly calls :ref:``delete`` on the removed element.
|
||||
Dynamic storage arrays and ``bytes`` (not ``string``) have a member function called ``pop`` that you can use to remove an element from the end of the array. This also implicitly calls :ref:`delete<delete>` on the removed element.
|
||||
|
||||
.. warning::
|
||||
If you use ``.length--`` on an empty array, it causes an underflow and
|
||||
@ -234,7 +234,7 @@ Array Members
|
||||
storage is assumed to be zero-initialised, while decreasing
|
||||
the length has at least linear cost (but in most cases worse than linear),
|
||||
because it includes explicitly clearing the removed
|
||||
elements similar to calling :ref:``delete`` on them.
|
||||
elements similar to calling :ref:`delete<delete>` on them.
|
||||
|
||||
.. note::
|
||||
It is not yet possible to use arrays of arrays in external functions
|
||||
|
Loading…
Reference in New Issue
Block a user