documentation of v += e

This commit is contained in:
Vern Paxson 2018-07-26 12:29:50 -07:00
parent dfe0768fa1
commit 016a164bb6
2 changed files with 17 additions and 0 deletions

3
NEWS
View file

@ -277,6 +277,9 @@ New Functionality
- Bro now supports PPPoE over QinQ.
- An expression of the form v += e will append the value of the expression
e to the end of the vector v (of course assuming type-compatbility).
Changed Functionality
---------------------

View file

@ -599,6 +599,20 @@ Here is a more detailed description of each type:
|v|
A particularly common operation on a vector is to append an element
to its end. You can do so using:
.. code:: bro
v += e;
where if e's type is ``X``, v's type is ``vector of X``. Note that
this expression is equivalent to:
.. code:: bro
v[|v|] = e;
Vectors of integral types (``int`` or ``count``) support the pre-increment
(``++``) and pre-decrement operators (``--``), which will increment or
decrement each element in the vector.