const_iterator

C

Christopher

Can anyone point me to a source code example of a custom
const_iterator?

I've got my container class done with a custom iterator, but cannot
get a grasp on the details on how to implement the const_iterator.
 
S

sk_usenet

Christopher said:
Can anyone point me to a source code example of a custom
const_iterator?

I've got my container class done with a custom iterator, but cannot
get a grasp on the details on how to implement the const_iterator.

How about sharing the code that you have problem with? Someone here can then
help you better.
 
C

Christopher

How about sharing the code that you have problem with? Someone here can then
help you better.

--http://techytalk.googlepages.com

It's on a secure network not connected to the internet with no method
of electronic copy
I don't desire to spend 4 hours typing it again, as even a minimal
example would be 400 or so lines when there are so many classes
dependent on other classes and methods calling other methods, just to
make up this template.
Any simple example will probably get me passed the problem.
 
B

Brian Tyler

http://www.boost.org/doc/libs/1_35_0/libs/iterator/doc/
iterator_facade.html#a-constant-node-iterator

And.. they might even show you how to make a reverse_iterator into the
bargain.

A const_iterator *usually* means that it doesn't modify the object it is
iterating through, that *usually* means when it dereferences it returns a
constant reference, rather than a reference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top