This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Minimum/maximum operators are deprecated?
- From: Steven Bosscher <stevenb at suse dot de>
- To: gcc at gcc dot gnu dot org
- Cc: Gunther Piez <gpiez at web dot de>
- Date: Sat, 10 Sep 2005 14:08:22 +0200
- Subject: Re: Minimum/maximum operators are deprecated?
- References: <200509101348.56152.gpiez@web.de>
On Saturday 10 September 2005 13:48, Gunther Piez wrote:
> Why?
>
> I just switched my project to gcc-4.0.1 and now i get tons of warnings :-(
> I always found the min/max operators extremly useful, especially der
> assignment variations <?= and >?= . There isn't even an replacemant for
> them I am aware of.
> Hell, I even overloaded them :-) Ok, this is possible with some functions
> too, but I find it rather cumbersome (but, hey, other people use java and
> cold-blooded claim they are lucky with it).
> I hoped, they would make it one day into normal C :-/
> Is there a reason?
It was an ill-defined and poorly maintained language extension that was
broken in many cases. Proper replacements exist in standard C++:
From http://gcc.gnu.org/onlinedocs/gcc-4.0.1/gcc/Deprecated-Features.html:
"The G++ minimum and maximum operators (`<?' and `>?') and their compound
forms (`<?=') and `>?=') have been deprecated and will be removed in a future
version. Code using these operators should be modified to use std::min and
std::max instead."
Gr.
Steven