Re: C++ "good practices" regarding constifying a function parameter?

2016-08-08 Thread Scott Kostyshak
On Sun, Aug 07, 2016 at 12:48:35PM +0200, Abdelrazak Younes wrote: > I think one should think about c++11 as a new language if you really want to > take advantage of it. auto, range loop, new algorithm, etc are very nice but > mixing old style c++ and c++11 leads to confusing source code.

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-07 Thread Abdelrazak Younes
On 06/08/2016 21:58, Guillaume Munch wrote: But I agree that new move functionality in C++11 is really nice and I know that I have to unlearn the good practice I learned so many years ago in order to use them efficiently. The issue with c++11 move semantics is that it is an addition of a big

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-06 Thread Guillaume Munch
Le 06/08/2016 à 16:45, Abdelrazak Younes a écrit : On 06/08/2016 17:04, Guillaume Munch wrote: Le 06/08/2016 à 10:16, Abdelrazak Younes a écrit : (1) Do not commit any part of the patch because it is so minor. This is my preference because it doesn't bring anything and it can create

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-06 Thread Abdelrazak Younes
On 06/08/2016 17:04, Guillaume Munch wrote: Le 06/08/2016 à 10:16, Abdelrazak Younes a écrit : (1) Do not commit any part of the patch because it is so minor. This is my preference because it doesn't bring anything and it can create confusion for the beginner when compared with const

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-06 Thread Guillaume Munch
(For some reason the message did not get through, retrying. That's the second time this happens in the recent days. Anyone else experiences issues with gmane?) Le 06/08/2016 à 10:16, Abdelrazak Younes a écrit : (1) Do not commit any part of the patch because it is so minor. This is my

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-06 Thread José Abílio Matos
On Saturday, August 6, 2016 4:17:01 PM WEST Abdelrazak Younes wrote: > Exactly! > > Cheers, > Abdel. Can I use a 4K screen as the standard? ;-) FWIW I agree with the rational of having short/not too long functions, I am just saying that half a screen is an ambiguous measure. :-) -- José

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-06 Thread Abdelrazak Younes
On 06/08/2016 14:41, Vincent van Ravesteijn wrote: But, I guess the coding standard says that functions shouldn't be longer than something like half a screen. Exactly! Cheers, Abdel.

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-06 Thread Vincent van Ravesteijn
Op 6 aug. 2016 11:26 schreef "Abdelrazak Younes" : > > Hi Scott, > > Too late already but my 2 cents below :-) > > > On 27/07/2016 02:54, Scott Kostyshak wrote: >> >> The attached patch constifies a function parameter. My question is >> whether this patch causes more pain to other

Re: C++ "good practices" regarding constifying a function parameter?

2016-08-06 Thread Abdelrazak Younes
Hi Scott, Too late already but my 2 cents below :-) On 27/07/2016 02:54, Scott Kostyshak wrote: The attached patch constifies a function parameter. My question is whether this patch causes more pain to other developers than it does good to the code. The patch modifies a header that is

Re: C++ "good practices" regarding constifying a function parameter?

2016-07-29 Thread Scott Kostyshak
On Fri, Jul 29, 2016 at 03:43:45PM +0100, Guillaume Munch wrote: > All these are good reasons. OK it's in at 60e89213. Scott signature.asc Description: PGP signature

Re: C++ "good practices" regarding constifying a function parameter?

2016-07-29 Thread Guillaume Munch
Le 27/07/2016 à 22:19, Scott Kostyshak a écrit : For the function definition, the difference is in terms of documentation. If you are adding const in the definition because you find it clearer this way, then it is a good reason to change it. Yes this was my intention. To me it has the same

Re: C++ "good practices" regarding constifying a function parameter?

2016-07-28 Thread Richard Heck
On 07/27/2016 05:19 PM, Scott Kostyshak wrote: > So to double-check, no one is against the .cpp change I proposed, right? > (I will not commit the .h change after this helpful conversation) Yes, I think that's right. > Thanks for this detailed explanation, Guillaume. I think that small > things

Re: C++ "good practices" regarding constifying a function parameter?

2016-07-27 Thread Scott Kostyshak
On Wed, Jul 27, 2016 at 12:06:51PM +0100, Guillaume Munch wrote: > Hi Scott, > > > - f(…, bool b) > + f(…, bool const b) > > This being passed by value, this changes nothing for the declaration. > The two signatures are even considered equal for overloading (if it > came to this). So I

Re: C++ "good practices" regarding constifying a function parameter?

2016-07-27 Thread Guillaume Munch
Le 27/07/2016 à 01:54, Scott Kostyshak a écrit : The attached patch constifies a function parameter. My question is whether this patch causes more pain to other developers than it does good to the code. The patch modifies a header that is included in many of our .cpp files, so will cause a

Re: C++ "good practices" regarding constifying a function parameter?

2016-07-26 Thread Scott Kostyshak
On Tue, Jul 26, 2016 at 11:40:17PM -0400, Richard Heck wrote: > On 07/26/2016 08:54 PM, Scott Kostyshak wrote: > > The attached patch constifies a function parameter. My question is > > whether this patch causes more pain to other developers than it does > > good to the code. > > So the change

Re: C++ "good practices" regarding constifying a function parameter?

2016-07-26 Thread Richard Heck
On 07/26/2016 08:54 PM, Scott Kostyshak wrote: > The attached patch constifies a function parameter. My question is > whether this patch causes more pain to other developers than it does > good to the code. So the change is: -bool BufferView::scrollToCursor(DocIterator const & dit, bool