RE: [boost] Re: [iterator facade] Why is dereference const?

"Neal D. Becker" <ndbecker2@verizon.net> writes:
Good suggestion! I'll post the modified code if anyone is interested. Yes pleaze. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

"Neal D. Becker" <ndbecker2@verizon.net> writes:
Max Khesin wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
Good suggestion! I'll post the modified code if anyone is interested.
Yes pleaze.
Here is the current version:
distance_to doesn't belong here, and you can eliminate the corresponding cnt. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
Max Khesin wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
Good suggestion! I'll post the modified code if anyone is interested.
Yes pleaze.
Here is the current version:
distance_to doesn't belong here, and you can eliminate the corresponding cnt.
Actually, I like the one based on Vladimir Prus much better than the one I wrote, so here is the current:

"Neal D. Becker" <ndbecker2@verizon.net> writes:
David Abrahams wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
Max Khesin wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
Good suggestion! I'll post the modified code if anyone is interested.
Yes pleaze.
Here is the current version:
distance_to doesn't belong here, and you can eliminate the corresponding cnt.
Actually, I like the one based on Vladimir Prus much better than the one I wrote, so here is the current:
I don't love it. Count is overkill; you only need a bool. Also it only works when value_type is default-constructible. There's a reason I suggested optional<value_type>, you know ;-) -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
David Abrahams wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
Max Khesin wrote:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
Good suggestion! I'll post the modified code if anyone is interested.
Yes pleaze.
Here is the current version:
distance_to doesn't belong here, and you can eliminate the corresponding cnt.
Actually, I like the one based on Vladimir Prus much better than the one I wrote, so here is the current:
I don't love it. Count is overkill; you only need a bool. Also it only works when value_type is default-constructible. There's a reason I suggested optional<value_type>, you know ;-)
OK, this one looks good. increment now will invalidate cache, so this one will call the underlying function the exact correct number of times. Any comments?
participants (3)
-
David Abrahams
-
Max Khesin
-
Neal D. Becker