<?= is a non-standard C++ operator
does to +
. What it does, is to reduce
the left-hand side
to the right-hand side
, if the right-hand side was smaller. Nice for various shortest path algorithm
s and especially brute
shortest <?= this_distance
As all the other X= operators, it returns a reference to the (newly modified) left-hand side variable.
As all the other min/max operators, it is hardly ever used, and is not even supported by all compilers, so take care in using it! Usually writing
a = min(a,b); will be much more appreciated if others are to read what your code. Also, if you want to use this operator for other classes than the primitive types, you will have to overload it yourself. It is not enough to have < or <?.