[Development] qsizetype

Marc Mutz marc.mutz at qt.io
Thu Mar 9 09:14:46 CET 2023


On 08.03.23 15:30, Ahmad Samir wrote:
> So, named casts (static_cast) are better in such cases, as searching for 
> them in source code is much easier than searching for:
> - int(foo)
> - (int)foo
> - (int)(foo)

In which situation would you want to search for all casts in a piece of source 
code? Without the use of a semantic grep tool?

I wouldn't like the extra noise of a static_cast when a constructor call 
would suffice. Obviously, C-style casts should be avoided (in headers, 
IIRC, they're caught by headerscheck).

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at qt.io>
Principal Software Engineer

The Qt Company
Erich-Thilo-Str. 10 12489
Berlin, Germany
www.qt.io

Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht Charlottenburg,
HRB 144331 B



More information about the Development mailing list