[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-frameworks-devel
Subject:    Re: Updating our coding conventions and coding style for C++11
From:       Vlad Zahorodnii <vladzzag () gmail ! com>
Date:       2020-01-17 11:14:00
Message-ID: 1cee10f2-58d7-1653-6c21-750a1db32598 () gmail ! com
[Download RAW message or body]

On 1/16/20 7:46 PM, Kai Uwe Broulik wrote:
> for "auto" I think we should always annotate it with const, *, and/or & 
> where appropriate:
> 
> auto *something = new MyCustomType;
> auto *keyEvent = static_cast<QKeyEvent *>(event);
> const auto myList = QStringList({QLatin1String("FooThing"), 
> QLatin1String("BarThing")});
> auto &barRef = foo[bar];

I also prefer to do that. On the other hand, I'd like our code to be as
close as possible to Qt's code in terms of coding style. Perhaps, this
discussion must be moved to the Qt/Development mailing list unless the
question of annotating auto with const/*/& had been raised before there.

Cheers,
Vlad
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic