const_iterator

Discussion in 'C++' started by Christopher, Apr 14, 2008.

  1. Christopher

    Christopher Guest

    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.
     
    Christopher, Apr 14, 2008
    #1
    1. Advertising

  2. Christopher

    sk_usenet Guest

    "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
     
    sk_usenet, Apr 14, 2008
    #2
    1. Advertising

  3. Christopher

    Christopher Guest

    On Apr 14, 12:29 pm, "sk_usenet" <sometechyguy at gmail dot com>
    wrote:
    > "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


    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.
     
    Christopher, Apr 14, 2008
    #3
  4. Christopher

    Brian Tyler Guest

    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.
     
    Brian Tyler, Apr 15, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Partridge
    Replies:
    5
    Views:
    440
    Buster Copley
    Jul 24, 2003
  2. john smith

    const_iterator

    john smith, Aug 5, 2003, in forum: C++
    Replies:
    5
    Views:
    6,671
    Uwe Schnitker
    Aug 5, 2003
  3. CoolPint
    Replies:
    3
    Views:
    746
    CoolPint
    Dec 13, 2003
  4. Gernot Frisch

    incrementiing const_iterator

    Gernot Frisch, Sep 15, 2004, in forum: C++
    Replies:
    4
    Views:
    583
    Mike Wahler
    Sep 15, 2004
  5. Joseph Turian
    Replies:
    5
    Views:
    323
    Victor Bazarov
    Aug 2, 2005
Loading...

Share This Page