Does CPPCheck recommend using std::begin and std::cbegin instead of using array-to-pointer decay? For instance this code:
char buffer[100];
std:rotate(std::begin(buffer), std::begin(buffer) + 10, std::end(buffer));
is more meaningful than
std:rotate(buffer, buffer + 10, buffer + 100);
There are some cases where there cannot be a straightforward addition of std::begin.
Log in to post a comment.
Does CPPCheck recommend using std::begin and std::cbegin instead of using array-to-pointer decay? For instance this code:
char buffer[100];
std:rotate(std::begin(buffer), std::begin(buffer) + 10, std::end(buffer));
is more meaningful than
std:rotate(buffer, buffer + 10, buffer + 100);
There are some cases where there cannot be a straightforward addition of std::begin.