Regarding dereference type of Forward Iterators

Discussion in 'C++' started by gautamcool88@gmail.com, Apr 3, 2009.

  1. Guest

    I read in Boost C++ docs that the result of a deference on a model of
    Forward Iterator is T&, where T is the value type of the model of
    Forward Iterator. But I could not find the same statement in the SGI
    STL specification of Forward Iterator. Can anyone kindly point it out
    to me?

    Regards
    Gautam
     
    , Apr 3, 2009
    #1
    1. Advertising

  2. red floyd Guest

    On Apr 3, 3:38 am, "" <>
    wrote:
    > I read in Boost C++ docs that the result of a deference on a model of
    > Forward Iterator is T&, where T is the value type of the model of
    > Forward Iterator. But I could not find the same statement in the SGI
    > STL specification of Forward Iterator. Can anyone kindly point it out
    > to me?


    It doesn't matter what the SGI spec says. It only matters what the
    Standard says.

    Table 74 in 24.1.3 of ISO/IEC 14882:2003 specifies that *a has return
    type T&.
     
    red floyd, Apr 3, 2009
    #2
    1. Advertising

  3. James Kanze Guest

    On Apr 3, 6:21 pm, red floyd <> wrote:
    > On Apr 3, 3:38 am, "" <>
    > wrote:


    > > I read in Boost C++ docs that the result of a deference on a
    > > model of Forward Iterator is T&, where T is the value type
    > > of the model of Forward Iterator. But I could not find the
    > > same statement in the SGI STL specification of Forward
    > > Iterator. Can anyone kindly point it out to me?


    > It doesn't matter what the SGI spec says. It only matters
    > what the Standard says.


    > Table 74 in 24.1.3 of ISO/IEC 14882:2003 specifies that *a has
    > return type T&.


    There's also a requirement that if a and b are iterators, and a
    == b, that *a and *b refer to the same object, i.e. that &*a ==
    &*b. Which is really too restrictive in the case of
    non-mutating iterators.

    --
    James Kanze (GABI Software) email:
    Conseils en informatique orientée objet/
    Beratung in objektorientierter Datenverarbeitung
    9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
     
    James Kanze, Apr 4, 2009
    #3
    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. qazmlp
    Replies:
    1
    Views:
    614
    Jonathan Turkanis
    Feb 15, 2004
  2. Marcin Kaliciñski

    Iterators and reverse iterators

    Marcin Kaliciñski, May 8, 2005, in forum: C++
    Replies:
    1
    Views:
    498
    Kai-Uwe Bux
    May 8, 2005
  3. Mark Stijnman
    Replies:
    5
    Views:
    515
    Mark Stijnman
    Jan 28, 2006
  4. Replies:
    7
    Views:
    336
    Prasad Patil
    Jul 11, 2008
  5. , India
    Replies:
    10
    Views:
    1,092
    James Kanze
    Aug 8, 2009
Loading...

Share This Page