octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto and const_iterators


From: John W. Eaton
Subject: Re: auto and const_iterators
Date: Wed, 2 May 2018 18:10:04 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 05/02/2018 06:06 PM, Rik wrote:
On 05/02/2018 02:52 PM, John W. Eaton wrote:

Either solution is OK with me, but I see more lines that remove
const_iterator than iterator.  Are the only ones we have to change the
ones where the object itself is not const but we were accessing elements
with a const_iterator?

That's right.  It's only when we want to confirm to the compiler that the
access should be read-only which is only necessary for a mutable object.
If the entire object is const already then all accesses are necessarily
read-only.

OK, I can fix this, but is there an easier way to find them other than manually looking at each of the instances where a const_iterator declaration was replaced by auto?

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]