Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > const_iterator

Reply
Thread Tools

const_iterator

 
 
Christopher
Guest
Posts: n/a
 
      04-14-2008
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.

 
Reply With Quote
 
 
 
 
sk_usenet
Guest
Posts: n/a
 
      04-14-2008

"Christopher" <> wrote in message
> 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.

--
http://techytalk.googlepages.com



 
Reply With Quote
 
 
 
 
Christopher
Guest
Posts: n/a
 
      04-14-2008
On Apr 14, 12:29 pm, "sk_usenet" <sometechyguy at gmail dot com>
wrote:
> "Christopher" <cp...@austin.rr.com> wrote in message
> > 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.
>
> --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.
 
Reply With Quote
 
Brian Tyler
Guest
Posts: n/a
 
      04-15-2008
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot make const_iterator of templatized hash_map Joseph Turian C++ 5 08-02-2005 08:17 PM
incrementiing const_iterator Gernot Frisch C++ 4 09-15-2004 02:43 PM
Questions about Getting const_iterator out of iterator class CoolPint C++ 3 12-13-2003 04:13 AM
const_iterator john smith C++ 5 08-05-2003 10:35 AM
why is map::begin() returning const_iterator? Tim Partridge C++ 5 07-24-2003 08:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57