Re: About replacing some "C-Array" into std::array

2019-11-22 Thread Chris Sherlock
On 23 Nov 2019, at 5:05 am, Luboš Luňák wrote: > > On Friday 22 of November 2019, julien2412 wrote: >> The goal is to replace some loops with std:: . Of course, I don't >> want to use std:: if I need to add a complicated lambda. >> About "don't fix what is not broken", I disagree here. >> What ab

Re: About replacing some "C-Array" into std::array

2019-11-22 Thread Luboš Luňák
On Friday 22 of November 2019, julien2412 wrote: > The goal is to replace some loops with std:: . Of course, I don't > want to use std:: if I need to add a complicated lambda. > About "don't fix what is not broken", I disagree here. > What about removing unused parts and optimizing? After all unuse

Re: About replacing some "C-Array" into std::array

2019-11-22 Thread julien2412
Luboš Luňák wrote >> ... >> To use std::fill, we'd need to convert the C array into std::array. > > No, we wouldn't: std::fill( array, array + 10, value ); Indeed, I saw I was wrong when reading the Mike's response. Luboš Luňák wrote >> ... > I think there wouldn't be any performance gain. W

Re: About replacing some "C-Array" into std::array

2019-11-22 Thread Luboš Luňák
On Friday 22 of November 2019, julien2412 wrote: > Hello, > > Taking a look at cppcheck report, I noticed this kind of reports: > vcl/source/treelist/transfer.cxx > 132 useStlAlgorithm 398 style Consider using std::fill algorithm > instead of > a raw loop Note that it says "style". Style

[RESOLVED] Re: About replacing some "C-Array" into std::array

2019-11-22 Thread Julien Nabet
On 22/11/2019 16:44, Kaganski Mike wrote: On 22.11.2019 18:31, julien2412 wrote: Taking a look at cppcheck report, I noticed this kind of reports: vcl/source/treelist/transfer.cxx 132 useStlAlgorithm 398 style Consider using std::fill algorithm instead of a raw loop To use std::fill,

Re: About replacing some "C-Array" into std::array

2019-11-22 Thread Kaganski Mike
On 22.11.2019 18:31, julien2412 wrote: > Taking a look at cppcheck report, I noticed this kind of reports: > vcl/source/treelist/transfer.cxx > 132 useStlAlgorithm 398 style Consider using std::fill algorithm > instead of > a raw loop > > To use std::fill, we'd need to convert the C array