开发者

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

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 larg开发者_如何学JAVAer) of two values, but I've never seen this operator combination. Any ideas on what this is?


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

They are no longer supported.


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++.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜