[Development] RFC: more liberal 'auto' rules?

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Dec 22 11:59:03 CET 2015


Il 22/12/2015 11:26, Ziller Eike ha scritto:
> So funny/unwanted behavior can occur both because one used the wrong explicit type, and because one used auto instead of an explicit type.

These shortcomings of auto are recognized in the community, but yes, 
they're real and dangerous. Clazy [1] already has a warning for the 
danger of auto with QStringBuilder, I guess it can be extended to other 
cases.

N4035 [2] proposes general purpose workarounds ("operator auto", 
specializations to std::decay, etc.) to address these issues.

> [1] https://github.com/KDE/clazy/blob/master/README
> [2] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4035.pdf

My 2 c,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company | Tel: UK +44-1625-809908
KDAB - The Qt Experts

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4068 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20151222/073f5f9a/attachment.bin>


More information about the Development mailing list