Regarding dereference type of Forward Iterators

G

gautamcool88

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
 
R

red floyd

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&.
 
J

James Kanze

On Apr 3, 3:38 am, "(e-mail address removed)" <[email protected]>
wrote:
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.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top