[Interest] Operator QMap<uint, uint>[] is casting to int?

Jason H jhihn at gmx.com
Tue May 7 14:50:27 CEST 2019



> Sent: Tuesday, May 07, 2019 at 8:44 AM
> From: "Christian Gagneraud" <chgans at gmail.com>
> To: "Ola Røer Thorsen" <ola at silentwings.no>
> Cc: "interestqt-project.org" <interest at qt-project.org>
> Subject: Re: [Interest] Operator QMap<uint, uint>[] is casting to int?
>
> On Wed, 8 May 2019 at 00:14, Ola Røer Thorsen <ola at silentwings.no> wrote:
> >
> >
> > lør. 4. mai 2019 kl. 17:51 skrev Thiago Macieira <thiago.macieira at intel.com>:
> >>
> >> No, the size of something definitely fits in int on 32-bit systems. And why do
> >> you need to do any static_cast in the first place?
> >
> >
> > We build our code using gcc with the options "-Wall -Wextra -Werror" and this leads us to have to use static_cast for example when comparing int and unsigned int (or std::size_t). A mix of using std::array, std::string and QVector/QByteArray often gives a few extra static casts, not that it bothers me too much.
> 
> Same here, with the added pain of compiling qt with qreal=float for
> arm-linux and qt=double for x86-linux/windows

IIRC, there was [fairly] recently  a discussion on the Qt development list about that... Might want to check the archives.





More information about the Interest mailing list