4

Possible Duplicate:
What does the >?= operator mean?

I found this code segment

...
for(k=i+1;k<j;k++) r <?= go(i,k,b)+go(k,j,b);
for(k='A';k<='Z';k++) r <?= 1+go(i,j,k);
...

I'm interested in <?= operator. It seems to me that it should compare value of r with right side of the operator and in case that right side is greater than r it should assign right side to r. I would like to know where are this (and similar operators, I suppose) defined and what should I do make them available for use with g++ compiler?

Community
  • 1
  • 1
plesiv
  • 6,935
  • 3
  • 26
  • 34
  • 1
    It's a pity that this doesn't have a standard operator. I use this type of assignment so often that I tend to include it as a member function `numclass::push_downto(const numclass &)` in number-like classes, but that's not really good style and you can't do it at all for plain primitive types. – leftaroundabout May 21 '11 at 01:07
  • It was the minimum assginment operator, the value was assigned if the right side was smaller – Gunther Piez May 21 '11 at 01:31

3 Answers3

16

The <?= operator was a GCC extension that was removed in version 4.2. See this question.

Use std::min instead.

Community
  • 1
  • 1
hammar
  • 138,522
  • 17
  • 304
  • 385
2

I don't think that this is a valid C++ operator

George Kastrinis
  • 4,924
  • 4
  • 29
  • 46
0

Not doable. The operators that C++ supports are fixed, you can't add new ones.

Andrew
  • 2,530
  • 16
  • 9