Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are >? or <? legitimate operators in any C++ dialect?

Tags:

c++

operators

I ran across the following lines of C++ code in a file (non-contiguous lines) that gcc 4.2.1 won't accept:

int frame = blk <? mBlkCnt-1;
mInsCnt = blk <? mBlkCnt;
mInsCnt = mInsCnt+1 <? mBlkCnt;
const int to_read = (mFileSz-byte_off) <? mBlkSz;

Both <? and >? are used in various places in the code. They appear to be a shorthand for assigning the smaller (or larger) of two values, but I've never seen this operator combination. Any ideas on what this is?

like image 272
molbioguy Avatar asked Oct 16 '10 16:10

molbioguy


2 Answers

They're called the min and max operators and were language extensions in earlier versions of gcc.

They are no longer supported.

like image 187
sepp2k Avatar answered Oct 20 '22 21:10

sepp2k


It's not a C++ operator, that's for sure. It almost resembles a digraph, but certainly not a valid one. In any case, a digraph, if supported, would just result in punctuation, not a whole new operator.

So, in answer to your question, perhaps this file needs to be preprocessed by some preprocessor that converts it to valid C++.

like image 22
Michael Goldshteyn Avatar answered Oct 20 '22 23:10

Michael Goldshteyn