Open andreas-bok-sociomantic opened 5 years ago
const
was added to all parameters which weren't mutated in the function. However as you note it might be redundant for the arguments passed by value.
Seems there isn't a general agreement on whether to pass primitive types by const
. It is recommended not to pass such as const ref
, e.g. (const int &i)
.
Thus using const
in cases here doesn't make much difference wrt. efficiency but does provide the clarity in the API that the function won't mutate the argument.
Updated based on comments from @daniel-zullo-sociomantic
Documentation needs to be updated
Updated rst documentation
The Use relnotes folder to describe new features
commit seems unrelated to this PR. It could easily be merged on its own.
The Use relnotes folder to describe new features commit seems unrelated to this PR. It could easily be merged on its own.
Hmm true. v7.x.x
is behind v6.x.x
but somehow I managed to get the commit with the relnotes folder onto it 🤦♂️ . I will block this until v6.2.0
has been released and v6.x.x
has been merged into v7.x.x
Adds
const
qualifier to POD params which are not mutated by the function.Since it is (possibly) a breaking change for clients it is added to the milestone for the next
major
release