1

Possible Duplicates:
C++ weird usage of conditional operator (>?=)
C extension: <? and >? operators

When i read a C++ code,i see the following lines:

void add(double v) { min <?= v; max >?= v; StatFig::add(v); }

What does the

>?=

means?

Thanks.

Community
  • 1
  • 1
David
  • 91
  • 1
  • 7

2 Answers2

1

Answered right here: Link.

As explained by the great answer there which i in no way take credit for, it's a deprecated GCC extension, and in no way standard C++. Avoid.

Community
  • 1
  • 1
Andreas Eriksson
  • 8,979
  • 8
  • 47
  • 65
0

There is a list of operators in C++ on wikipedia, but it's not in here, so maybe it's defined elsewhere in the code you read.

My guess would be that's it's an assignement operator that checks if the value is lower/higher than a certain threshold, and if so assigns that threshold to the variable. Or something

In other words, min <?= v might be equivalent to min=((min<v)?min:v), but that's just a guess.

Joubarc
  • 1,206
  • 10
  • 17