You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which will call void foo(int &a) since we have removed the constness from the iterators.
To properly fix the issue the fix-it should add as_const around the range and include <utiity> if the user was previously using cbegin() and cend().
The fix-it for modernize-use-ranges changes the constness on some function calls.
Let's assume the following example :
The method currently calls
void foo(const int& a)
since we are usingcbegin()
andcend()
, but after applying the fix-it the code looks like this :Which will call void foo(int &a) since we have removed the constness from the iterators.
To properly fix the issue the fix-it should add
as_const
around the range and include<utiity>
if the user was previously usingcbegin()
andcend()
.godbolt: https://godbolt.org/z/MPnoo4vGY
The text was updated successfully, but these errors were encountered: