Article View: comp.std.c++
Article #1845iterators and ->
From: Tony Cook
Date: Fri, 25 Aug 1995 06:13
Date: Fri, 25 Aug 1995 06:13
27 lines
1238 bytes
1238 bytes
Why don't iterators support the '->' operator - which would be more
convenient than '(*i).'?
I know this has been asked before - but the response has usually been
that -> won't work where the container is an 'int'.
But:
===
14.3.3 Instantiation of operator-> [temp.opref]
1 If a template class has an operator->, that operator-> can have a
return type that cannot be dereferenced by -> as long as that opera-
tor-> is neither invoked, nor has its address taken, isn't virtual,
nor is explicitly instantiated.
===
Is there some other reason?
--
Tony Cook - tony@online.tmx.com.au
100237.3425@compuserve.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<MATT.95Aug24221328@Austern>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!MattShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt From: Tony Cook <tony@online.tmx.com.au> Newsgroups: comp.std.c++ Subject: iterators and -> Date: 25 Aug 1995 06:13:28 GMT Organization: Home Approved: Matt@Austern Message-ID: <MATT.95Aug24221328@Austern> NNTP-Posting-Host: austern.hip.berkeley.edu