0

Possible Duplicate:
C extension: <? and >? operators
What does the >?= operator mean?

I was googling some C++ codes on the internet and just found this:

num <?= num2-num3+num4;

Does anyone knows what this operator stands for? I googled for it but found anything.

Community
  • 1
  • 1
user888360
  • 75
  • 1
  • 6
  • 2
    possible duplicate of [C extension: and >? operators](http://stackoverflow.com/questions/3437410/c-extension-and-operators) and [What does the >?= operator mean?](http://stackoverflow.com/questions/5199630/what-does-the-operator-mean) – CB Bailey Nov 07 '11 at 22:43
  • 3
    and people mock MSVC for not following standards and adding extensions :D – Mooing Duck Nov 07 '11 at 22:43

2 Answers2

5

It was a GCC extension at some point, now removed. It is the assignment version of <? which was simply the minimum operator. So that code reads "set num to num2-num3+num4 if that is smaller than num". In standard C++:

num = std::min(num, num2-num3+num4);
Max
  • 1,620
  • 15
  • 22
3

It's a gcc extension, basically means

num = std::min(num, rhs);
Ben Voigt
  • 277,958
  • 43
  • 419
  • 720