For example, in C ++ there is an operator += :

 x += 7; 

which is an abbreviated record of the + operator, followed by assignment:

 x = x + 7; 

Is there a programming language that has the operator min= or =min :

 x =min 7 

which would be an abbreviated record of taking a minimum followed by assignment:

 x = min(x, 7) 

?

  • 2
    I think what you need (early version of gcc ): stackoverflow.com/questions/5199630/what-does-the-operator-mean - Ares
  • one
    ...but why? [picture with a trolley bus] - andreymal
  • @AresGod cool, pity that he was removed - user268670
  • @andreymal, for example, can be useful in the constructions very_big_variable_name = min(very_big_variable_name, 7) or array[index1][index2] = min(array[index1][index2], 7) or somevariable.somemethod_returns_lvalue() = min(somevariable.somemethod_returns_lvalue(), 7) - user268670
  • 2
    It seems that for this it would be better to just write a reducing macro) - andreymal

0