Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Regarding dereference type of Forward Iterators

Reply
Thread Tools

Regarding dereference type of Forward Iterators

 
 
gautamcool88@gmail.com
Guest
Posts: n/a
 
      04-03-2009
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
 
Reply With Quote
 
 
 
 
red floyd
Guest
Posts: n/a
 
      04-03-2009
On Apr 3, 3:38*am, "gautamcoo...@gmail.com" <gautamcoo...@gmail.com>
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&.
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      04-04-2009
On Apr 3, 6:21 pm, red floyd <redfl...@gmail.com> wrote:
> On Apr 3, 3:38 am, "gautamcoo...@gmail.com" <gautamcoo...@gmail.com>
> 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
 
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
plain iterators and reverse iterators on vector subramanian100in@yahoo.com, India C++ 10 08-08-2009 08:28 AM
Query regarding iterators and vector prasadmpatil@gmail.com C++ 7 07-11-2008 03:15 AM
Forward iterators and past-the-end iterator Mark Stijnman C++ 5 01-28-2006 08:56 PM
Iterators and reverse iterators Marcin Kaliciñski C++ 1 05-08-2005 09:58 AM
Re-forward declaration of types which were already forward declared qazmlp C++ 1 02-15-2004 07:00 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