[prog] wierd C++ operator

Jimen Ching jching at flex.com
Tue May 27 18:43:38 EST 2003


On Tue, 27 May 2003, ed orphan wrote:
>I've never seen this C++ operator...  <? before. It works with GNU C++,
>but is it portable? Is this operator included in any standard like ANSI
>or POSIX ?

I'm looking at the ISO C++ standard and I don't see this operator.  It
wouldn't be in POSIX since an operator would be part of the language and
not in a library like POSIX.

Of course, I don't see why you can't get the same behavior with:

	result = whatever < 1000 ? 1000 : whatever;

Perhaps the GNU people think

	result = 1000 <? whatever;

is less code to write and thus, is better or something.  Personally, I
prefer the verbose statement.  It tells me exactly what the statement is
trying to do.

--jc
-- 
Jimen Ching (WH6BRR)      jching at flex.com     wh6brr at uhm.ampr.org


More information about the Programming mailing list