std::max: if versus ?:

Marc Glisse marc.glisse@inria.fr
Sun Sep 23 16:39:00 GMT 2012


On Sun, 23 Sep 2012, Gabriel Dos Reis wrote:

> I think I have a preference for reverting the patch.

I don't mind, but could you explain what makes you prefer:
       if (__a < __b)
         return __b;
       return __a;
to:
       return  __a < __b ? __b : __a;
?

It would be useful to know, for next time. The only reason I can think of 
for reverting is that if I manage to implement ?: for vectors, it will 
give a hard error instead of a warning.

-- 
Marc Glisse



More information about the Libstdc++ mailing list