This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: operands to min and max must have the same type...
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: 04 Mar 2003 23:48:25 -0300
- Subject: Re: operands to min and max must have the same type...
- Organization: GCC Team, Red Hat
- References: <oradggyqun.fsf@free.redhat.lsd.ic.unicamp.br><20030304161138.51f78591.bkoz@redhat.com>
On Mar 4, 2003, Benjamin Kosnik <bkoz at redhat dot com> wrote:
> - ptrdiff_t new_size = std::max(2 * old_size, ptrdiff_t(1));
> + ptrdiff_t new_size = std::max(ptrdiff_t (2 * old_size), ptrdiff_t (1));
> Should be:
> ptrdiff_t new_size = std::max(static_cast<ptrdiff_t>(2 * old_size), ptrdiff_t (1));
Err... I don't understand. Why must one of them be a static_cast
while the other is ok as a functional cast? Are conventions like this
documented anywhere?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva at {redhat dot com, gcc.gnu.org}
CS PhD student at IC-Unicamp oliva at {lsd dot ic dot unicamp dot br, gnu.org}
Free Software Evangelist Professional serial bug killer