Re: Updating our coding conventions and coding style for C++11

2020-01-19 Thread Elvis Angelaccio
Hi, On 16/01/20 18:46, Kai Uwe Broulik wrote: > Hi, > > for "auto" I think we should always annotate it with const, *, and/or & > where appropriate: > > auto *something = new MyCustomType; > auto *keyEvent = static_cast(event); IMHO the * here is redundant and only adds noise. It's clear that

Re: Updating our coding conventions and coding style for C++11

2020-01-17 Thread Vlad Zahorodnii
On 1/17/20 12:27 AM, David Faure wrote: > On jeudi 16 janvier 2020 18:29:11 CET Vlad Zahorodnii wrote: >> I would like us to copy Qt's policy [1] for consistency: > > OK, please do. Done. Please notice that I did not annotate auto keywords with '*'. Once we have an official policy, we can fix

Re: Updating our coding conventions and coding style for C++11

2020-01-17 Thread Vlad Zahorodnii
On 1/16/20 7:29 PM, Vlad Zahorodnii wrote: > The common practice used in KDE seems to be: > > for (a:b) Alright, it looks like we all agree on this one, so I'm going to update the Frameworks Coding Style.

Re: Updating our coding conventions and coding style for C++11

2020-01-17 Thread Vlad Zahorodnii
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(event); > const auto myList = QStringList({QLatin1String("FooThing"), >

Re: Updating our coding conventions and coding style for C++11

2020-01-17 Thread Vlad Zahorodnii
On 1/17/20 12:46 AM, Kai Uwe Broulik wrote: > It provides useful visual information. > > auto foo = bar(); > auto baz = I don't think that you should use auto in either case since it's not clear what type foo and baz have. Cheers, Vlad

Re: Updating our coding conventions and coding style for C++11

2020-01-17 Thread David Edmundson
On Thu, 16 Jan 2020, 22:46 Kai Uwe Broulik, wrote: > > > Well, the * is completely redundant in those cases, so it doesn't bring > anything. > > I'd be tempted to say, let's not require it. > > But then it raises the question of consistency (without a guideline, > we'll have some places with *

Re: Updating our coding conventions and coding style for C++11

2020-01-16 Thread Friedrich W. H. Kossebau
Am Donnerstag, 16. Januar 2020, 23:27:57 CET schrieb David Faure: > On jeudi 16 janvier 2020 18:29:11 CET Vlad Zahorodnii wrote: > > I would like us to copy Qt's policy [1] for consistency: > OK, please do. +1, thanks for the initiative, Vlad. > Kai-Uwe wrote: > > for "auto" I think we should

Re: Updating our coding conventions and coding style for C++11

2020-01-16 Thread David Jarvie
On Thursday 16 Jan 2020 18:46:06 Kai Uwe Broulik wrote: > Hi, > > for "auto" I think we should always annotate it with const, *, and/or & > where appropriate: > > auto *something = new MyCustomType; > auto *keyEvent = static_cast(event); > const auto myList =

Re: Updating our coding conventions and coding style for C++11

2020-01-16 Thread Kai Uwe Broulik
Well, the * is completely redundant in those cases, so it doesn't bring anything. I'd be tempted to say, let's not require it. But then it raises the question of consistency (without a guideline, we'll have some places with * and some places without *). It provides useful visual

Re: Updating our coding conventions and coding style for C++11

2020-01-16 Thread David Faure
On jeudi 16 janvier 2020 18:29:11 CET Vlad Zahorodnii wrote: > I would like us to copy Qt's policy [1] for consistency: OK, please do. > for (a:b) +1 Kai-Uwe wrote: > for "auto" I think we should always annotate it with const, *, and/or & > where appropriate: > auto *something = new

Re: Updating our coding conventions and coding style for C++11

2020-01-16 Thread Kai Uwe Broulik
Hi, for "auto" I think we should always annotate it with const, *, and/or & where appropriate: auto *something = new MyCustomType; auto *keyEvent = static_cast(event); const auto myList = QStringList({QLatin1String("FooThing"), QLatin1String("BarThing")}); auto = foo[bar]; The common

Updating our coding conventions and coding style for C++11

2020-01-16 Thread Vlad Zahorodnii
Hi, I would like to update our coding conventions https://community.kde.org/Policies/Library_Code_Policy. The auto keyword is not mentioned leading to it being a common point of contention in reviews as we can't point to a reference. I would like us to copy Qt's policy [1] for consistency: