Topic: if( container.have( forward_iterator & reverse_iterator ){ container.must_have( bidirectional_iterator ); } else{ }
Author: kuyper@wizard.net (James Kuyper)
Date: Thu, 20 May 2004 18:45:44 +0000 (UTC) Raw View
jpotter@falcon.lhup.edu (John Potter) wrote in message news:<fjMqc.21457$KE6.3776@newsread3.news.atl.earthlink.net>...
> On Wed, 19 May 2004 14:43:05 +0000 (UTC), kuyper@wizard.net (James
> Kuyper) wrote:
>
> > There's no
> > reason why a container with forward and reverse iterators must have
> > bidirectional iterators; the STL doesn't contain any examples of that,
> > but there's no requirement, either from logic or the standard, why it
> > couldn't.
>
> What is a reverse_iterator? The standard defines it as a bidirecrtional
> iterator whose increment and decrement operations are reversed. If a
> container has a reverse_iterator, it has a bidirectional_iterator. A
> reverse_iterator is a bidirectional_iterator by definition.
>
> If the intent is to talk about an iterator which moves backwards through
> a container, then name it something other than reverse_iterator which
> has a standard meaning.
reverse_iterator has a meaning defined by the standard in certain
contexts. However, it's perfectly legal for a user-defined class to
have a member named reverse_iterator, that doesn't match that meaning,
so long as it's not used in one of those contexts. In particular, a
class with a non-standard meaning for its reverse_iterator member
should never be used in a context where a reversible container is
required.
What I really meant was something a little different. The standard
defines a std::reverse_iterator<> class template, but it doesn't
define what a reverse iterator is. I think it's legal for a class
named Container to
1. meet all of the Table 65 requirements
2. have members named Container::reverse_iterator and
Container::const_reverse_iterator which are not typedefs for
std::reverse_iterator<Container::iterator>
3. Have it's reverse iterator types meet all of the forward iterator
requirements.
4. Have it's reverse iterator types access the elements of the
container in the reverse of the order that Container::iterator does.
5. Have rbegin() and rend() members.
6. Have no bidirectional iterators.
Because of items 2 and 6, such a class could not qualify as a
reversible container.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kuyper@wizard.net (James Kuyper)
Date: Thu, 20 May 2004 21:10:42 +0000 (UTC) Raw View
I@ddmrm.com ("DEX") wrote in message news:<2h0nh7F7odlvU1@uni-berlin.de>...
> "John Potter" <jpotter@falcon.lhup.edu> wrote in message
> news:Xv7qc.12797$zO3.2908@newsread2.news.atl.earthlink.net...
> > On Mon, 17 May 2004 17:18:13 +0000 (UTC), kuyper@wizard.net (James
> > Kuyper) wrote:
..
> > > A class with both forward and reverse iterators, but lacking a
> > > bi-directional iterator would fail to meet the requirements for
> > > reversible containers, but he didn't ask about reversible containers.
> > > He asked about containers with both forward and reverse iterators,
> > > which is a broader category.
> >
> > It seemed to me that the question was about standard containers in
> > comp.std.c++.
> YES and NO.
>
> >There is no container between simple container and
> > reversible container.
> >If this thing is a container matching standard
> > requirements, it is either a plain container without reverse_iterator
> > or a reversible container.
>
> I think there is a another type of container between simple and
> bi-directional.
Certainly; but it's not a type named in the standard. Incidentally -
"bidirectional" isn't a standard container type category's name,
either. I assume you mean "reversible"?
> Acording to ISO-14882 ansver is YES, because says it must be ( without
> "mathematical" proof ).
> However I think the answr is NO.
I'm not sure what you mean by either of those statements. Could you
explain what ISO-14882 says, that corresponds to "YES"?
> This is an example and the answer why I think so:
>
> struct container_simple //!< well known simple container
> {
> typedef ... iterator_forward, iterator;
> };
>
> struct container_forward_reverse //!< mising link
> : container_simple
> {
> typedef ... iterator_reverse;
> };
>
> struct container_bidirectional //!< it could look like
> : container_forward_reverse
> {
> struct iterator_forward : iterator_forward
> {
> // there must to be converters from iterator_forward to
> iterator_reverse
That's a good idea, but I'm not sure where your "must" comes from.
Citation, please?
> iterator_forward( iterator_reverse const& );
> operator iterator_reverse()const;
> };
>
> struct iterator_reverse : iterator_reverse
> {
> // there must be converters from iterator_reverse to iterator_forward
> iterator_reverse( iterator_forward const& );
> operator iterator_forward()const;
> };
> };
As I read table 66, for a reversible container type,
Container::reverse_iterator is required to be a typedef for
std::reverse_iterator<Container::iterator>. That template class
contains the needed conversions, so that requirement is suffiecient.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kuyper@wizard.net (James Kuyper)
Date: Mon, 17 May 2004 17:18:13 +0000 (UTC) Raw View
jpotter@falcon.lhup.edu (John Potter) wrote in message news:<9Japc.5929$zO3.4580@newsread2.news.atl.earthlink.net>...
> On Fri, 14 May 2004 20:34:42 +0000 (UTC), kuyper@wizard.net (James
> Kuyper) wrote:
>
> > I@ddmrm.com ("DEX") wrote in message news:<2ggunsF2lnpsU1@uni-berlin.de>...
> > > English version.
>
> > > If container has forward and reverse iterator does it mean that container
> > > must have bi-directional iterator.
>
> > There's no such requirement.
>
> Did you consider table 66?
Yes. It places requirements on reversible containers.
> > If Container::reverse_iterator is typedefd as
> > std::reverse_iterator<Container::iterator>, then Container::iterator
> > must be bidirectional (24.1.4).
>
> Table 66 gives no choice. If it is a reversible container, that typedef
> is required.
A class with both forward and reverse iterators, but lacking a
bi-directional iterator would fail to meet the requirements for
reversible containers, but he didn't ask about reversible containers.
He asked about containers with both forward and reverse iterators,
which is a broader category.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: jpotter@falcon.lhup.edu (John Potter)
Date: Mon, 17 May 2004 21:21:39 +0000 (UTC) Raw View
On Mon, 17 May 2004 17:18:13 +0000 (UTC), kuyper@wizard.net (James
Kuyper) wrote:
> jpotter@falcon.lhup.edu (John Potter) wrote in message news:<9Japc.5929$zO3.4580@newsread2.news.atl.earthlink.net>...
> > On Fri, 14 May 2004 20:34:42 +0000 (UTC), kuyper@wizard.net (James
> > Kuyper) wrote:
> > > I@ddmrm.com ("DEX") wrote in message news:<2ggunsF2lnpsU1@uni-berlin.de>...
> > > > English version.
> > > > If container has forward and reverse iterator does it mean that container
> > > > must have bi-directional iterator.
> > > There's no such requirement.
> > Did you consider table 66?
> Yes. It places requirements on reversible containers.
> > > If Container::reverse_iterator is typedefd as
> > > std::reverse_iterator<Container::iterator>, then Container::iterator
> > > must be bidirectional (24.1.4).
> > Table 66 gives no choice. If it is a reversible container, that typedef
> > is required.
> A class with both forward and reverse iterators, but lacking a
> bi-directional iterator would fail to meet the requirements for
> reversible containers, but he didn't ask about reversible containers.
> He asked about containers with both forward and reverse iterators,
> which is a broader category.
It seemed to me that the question was about standard containers in
comp.std.c++. There is no container between simple container and
reversible container. If this thing is a container matching standard
requirements, it is either a plain container without reverse_iterator
or a reversible container. We can't talk about requirements for some
fictious broader category here.
I wonder what the real question was and if either of us answered it to
the satisfaction of the poster.
John
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: I@ddmrm.com ("DEX")
Date: Tue, 18 May 2004 16:09:36 +0000 (UTC) Raw View
"James Kuyper" <kuyper@wizard.net> wrote in message
news:8b42afac.0405141224.9aed6f7@posting.google.com...
> I@ddmrm.com ("DEX") wrote in message
news:<2ggunsF2lnpsU1@uni-berlin.de>...
> > English version.
> >
> > If container has forward and reverse iterator does it mean that
container
> > must have bi-directional iterator.
>
> There's no such requirement.
I think that there must be another additional condition for container to
have bidirectional iterator
if it has reverse an forward.
Applying that question ( if( container.have ... ) to STL the ansver is YES.
>
> The converse, on the other hand, is true. If a container has a
> bi-directional or random iterator, it's required to provide both a
> forward and a reverse iterator (23.1.1p9), and the reverse iterator is
> required to be std::reverse_iterator<Container::iterator>.
>
> If Container::reverse_iterator is typedefd as
> std::reverse_iterator<Container::iterator>, then Container::iterator
> must be bidirectional (24.1.4). However, if Container::iterator is not
> bidirectional, then Container::reverse_iterator could still be
> defined, and doesn't have to be defined in terms of
> std::reverse_iterator,>.
>
> As a practical matter, I can't come up with a good reason why anyone
> would implement a container with both forward and reverse iterators,
> yet not provide a bidirectional iterator.
>
> ---
> [ comp.std.c++ is moderated. To submit articles, try just posting with ]
> [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
> [ --- Please see the FAQ before posting. --- ]
> [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
>
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kuyper@wizard.net (James Kuyper)
Date: Tue, 18 May 2004 16:57:49 +0000 (UTC) Raw View
jpotter@falcon.lhup.edu (John Potter) wrote in message news:<Xv7qc.12797$zO3.2908@newsread2.news.atl.earthlink.net>...
> On Mon, 17 May 2004 17:18:13 +0000 (UTC), kuyper@wizard.net (James
> Kuyper) wrote:
>
> > jpotter@falcon.lhup.edu (John Potter) wrote in message news:<9Japc.5929$zO3.4580@newsread2.news.atl.earthlink.net>...
..
> > > Table 66 gives no choice. If it is a reversible container, that typedef
> > > is required.
>
> > A class with both forward and reverse iterators, but lacking a
> > bi-directional iterator would fail to meet the requirements for
> > reversible containers, but he didn't ask about reversible containers.
> > He asked about containers with both forward and reverse iterators,
> > which is a broader category.
>
> It seemed to me that the question was about standard containers in
> comp.std.c++. There is no container between simple container and
> reversible container. If this thing is a container matching standard
> requirements, it is either a plain container without reverse_iterator
> or a reversible container. We can't talk about requirements for some
> fictious broader category here.
I think you mean "defined by", rather than merely "matching". A
container can match all of the requirements of table 65, and have
reverse_iterators, without matching all of the requirements of table
66.
What you're basically saying is that you think he was referring to
some particular named type category (such as container, reversible
container, sequence, or associative container). The problem is, the
only relevant category name he used was "container", which implies
Table 65, but nothing more.
> I wonder what the real question was and if either of us answered it to
> the satisfaction of the poster.
Agreed.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kuyper@wizard.net (James Kuyper)
Date: Wed, 19 May 2004 14:43:05 +0000 (UTC) Raw View
I@ddmrm.com ("DEX") wrote in message news:<2gu1j5F6ha6qU1@uni-berlin.de>...
> "James Kuyper" <kuyper@wizard.net> wrote in message
> news:8b42afac.0405141224.9aed6f7@posting.google.com...
> > I@ddmrm.com ("DEX") wrote in message
> news:<2ggunsF2lnpsU1@uni-berlin.de>...
> > > English version.
> > >
> > > If container has forward and reverse iterator does it mean that
> container
> > > must have bi-directional iterator.
> >
> > There's no such requirement.
>
> I think that there must be another additional condition for container to
> have bidirectional iterator
> if it has reverse an forward.
I can assure you that there is no such additional condition. Perhaps
you mean that there should be such an additional condition?
> Applying that question ( if( container.have ... ) to STL the ansver is YES.
You mean, that the STL has no such containers, and you're correct.
However, you used "must_have" rather than "does_have". There's no
reason why a container with forward and reverse iterators must have
bidirectional iterators; the STL doesn't contain any examples of that,
but there's no requirement, either from logic or the standard, why it
couldn't.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: I@ddmrm.com ("DEX")
Date: Wed, 19 May 2004 14:50:16 +0000 (UTC) Raw View
"John Potter" <jpotter@falcon.lhup.edu> wrote in message
news:Xv7qc.12797$zO3.2908@newsread2.news.atl.earthlink.net...
> On Mon, 17 May 2004 17:18:13 +0000 (UTC), kuyper@wizard.net (James
> Kuyper) wrote:
>
> > jpotter@falcon.lhup.edu (John Potter) wrote in message
news:<9Japc.5929$zO3.4580@newsread2.news.atl.earthlink.net>...
>
> > > On Fri, 14 May 2004 20:34:42 +0000 (UTC), kuyper@wizard.net (James
> > > Kuyper) wrote:
>
> > > > I@ddmrm.com ("DEX") wrote in message
news:<2ggunsF2lnpsU1@uni-berlin.de>...
> > > > > English version.
>
> > > > > If container has forward and reverse iterator does it mean that
container
> > > > > must have bi-directional iterator.
>
> > > > There's no such requirement.
>
> > > Did you consider table 66?
>
> > Yes. It places requirements on reversible containers.
>
> > > > If Container::reverse_iterator is typedefd as
> > > > std::reverse_iterator<Container::iterator>, then Container::iterator
> > > > must be bidirectional (24.1.4).
>
> > > Table 66 gives no choice. If it is a reversible container, that
typedef
> > > is required.
>
> > A class with both forward and reverse iterators, but lacking a
> > bi-directional iterator would fail to meet the requirements for
> > reversible containers, but he didn't ask about reversible containers.
> > He asked about containers with both forward and reverse iterators,
> > which is a broader category.
>
> It seemed to me that the question was about standard containers in
> comp.std.c++.
YES and NO.
>There is no container between simple container and
> reversible container.
>If this thing is a container matching standard
> requirements, it is either a plain container without reverse_iterator
> or a reversible container.
I think there is a another type of container between simple and
bi-directional.
Acording to ISO-14882 ansver is YES, because says it must be ( without
"mathematical" proof ).
However I think the answr is NO.
This is an example and the answer why I think so:
struct container_simple //!< well known simple container
{
typedef ... iterator_forward, iterator;
};
struct container_forward_reverse //!< mising link
: container_simple
{
typedef ... iterator_reverse;
};
struct container_bidirectional //!< it could look like
: container_forward_reverse
{
struct iterator_forward : iterator_forward
{
// there must to be converters from iterator_forward to
iterator_reverse
iterator_forward( iterator_reverse const& );
operator iterator_reverse()const;
};
struct iterator_reverse : iterator_reverse
{
// there must be converters from iterator_reverse to iterator_forward
iterator_reverse( iterator_forward const& );
operator iterator_forward()const;
};
};
> We can't talk about requirements for some
> fictious broader category here.
>
> I wonder what the real question was and if either of us answered it to
> the satisfaction of the poster.
>
> John
>
> ---
> [ comp.std.c++ is moderated. To submit articles, try just posting with ]
> [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
> [ --- Please see the FAQ before posting. --- ]
> [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
>
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: jpotter@falcon.lhup.edu (John Potter)
Date: Wed, 19 May 2004 17:15:20 +0000 (UTC) Raw View
On Wed, 19 May 2004 14:43:05 +0000 (UTC), kuyper@wizard.net (James
Kuyper) wrote:
> There's no
> reason why a container with forward and reverse iterators must have
> bidirectional iterators; the STL doesn't contain any examples of that,
> but there's no requirement, either from logic or the standard, why it
> couldn't.
What is a reverse_iterator? The standard defines it as a bidirecrtional
iterator whose increment and decrement operations are reversed. If a
container has a reverse_iterator, it has a bidirectional_iterator. A
reverse_iterator is a bidirectional_iterator by definition.
If the intent is to talk about an iterator which moves backwards through
a container, then name it something other than reverse_iterator which
has a standard meaning.
John
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: pjp@dinkumware.com ("P.J. Plauger")
Date: Thu, 20 May 2004 02:50:06 +0000 (UTC) Raw View
"John Potter" <jpotter@falcon.lhup.edu> wrote in message
news:fjMqc.21457$KE6.3776@newsread3.news.atl.earthlink.net...
> On Wed, 19 May 2004 14:43:05 +0000 (UTC), kuyper@wizard.net (James
> Kuyper) wrote:
>
> > There's no
> > reason why a container with forward and reverse iterators must have
> > bidirectional iterators; the STL doesn't contain any examples of that,
> > but there's no requirement, either from logic or the standard, why it
> > couldn't.
>
> What is a reverse_iterator? The standard defines it as a bidirecrtional
> iterator whose increment and decrement operations are reversed. If a
> container has a reverse_iterator, it has a bidirectional_iterator. A
> reverse_iterator is a bidirectional_iterator by definition.
Not exactly. Template class reverse_iterator can be specialized for
a random-access iterator, with full functionality as a random-access
iterator (that goes backwards). If you specialize it for a bidirectional
iterator, then you'd better use it as such; otherwise you'll get
compile errors.
> If the intent is to talk about an iterator which moves backwards through
> a container, then name it something other than reverse_iterator which
> has a standard meaning.
Agreed.
P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: I@ddmrm.com ("DEX")
Date: Fri, 14 May 2004 16:46:12 +0000 (UTC) Raw View
Nope.
Whit other words 24.4.1/1 says:
If container has bi-directional iterator then it must have forward and
reverse.
It is obvious.
My question is in reverse direction.
Mathematicly speaking:
Container have forward and reverse iterator if and only if have
bi-directional iterator.
24.4.1/1 give me proof from rigt to left .
I want left to right.
"llewelly" <llewelly.at@xmission.dot.com> wrote in message
news:86ekpoazwd.fsf@Zorthluthik.local.bar...
> I@ddmrm.com ("DEX") writes:
>
> > English version.
> >
> > If container has forward and reverse iterator does it mean that
container
> > must have bi-directional iterator.
> >
> > Example:
> > 1. std::vector have forward, reverse and bidirectional.
> > 2. std::list have forward, reverse and bidirectional.
>
> Maybe you want 24.4.1/1, which begins:
> [snip]
>
> # Bidirectional and random access iterators have corresponding
> # reverse iterator adaptors [...]
>
> ---
> [ comp.std.c++ is moderated. To submit articles, try just posting with ]
> [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
> [ --- Please see the FAQ before posting. --- ]
> [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
>
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: kuyper@wizard.net (James Kuyper)
Date: Fri, 14 May 2004 20:34:42 +0000 (UTC) Raw View
I@ddmrm.com ("DEX") wrote in message news:<2ggunsF2lnpsU1@uni-berlin.de>...
> English version.
>
> If container has forward and reverse iterator does it mean that container
> must have bi-directional iterator.
There's no such requirement.
The converse, on the other hand, is true. If a container has a
bi-directional or random iterator, it's required to provide both a
forward and a reverse iterator (23.1.1p9), and the reverse iterator is
required to be std::reverse_iterator<Container::iterator>.
If Container::reverse_iterator is typedefd as
std::reverse_iterator<Container::iterator>, then Container::iterator
must be bidirectional (24.1.4). However, if Container::iterator is not
bidirectional, then Container::reverse_iterator could still be
defined, and doesn't have to be defined in terms of
std::reverse_iterator,>.
As a practical matter, I can't come up with a good reason why anyone
would implement a container with both forward and reverse iterators,
yet not provide a bidirectional iterator.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: jpotter@falcon.lhup.edu (John Potter)
Date: Fri, 14 May 2004 22:52:06 +0000 (UTC) Raw View
On Fri, 14 May 2004 16:46:12 +0000 (UTC), I@ddmrm.com ("DEX") wrote:
> Mathematicly speaking:
> Container have forward and reverse iterator if and only if have
> bi-directional iterator.
> 24.4.1/1 give me proof from rigt to left .
> I want left to right.
24.4.1.2/1.
John
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: jpotter@falcon.lhup.edu (John Potter)
Date: Fri, 14 May 2004 22:52:13 +0000 (UTC) Raw View
On Fri, 14 May 2004 20:34:42 +0000 (UTC), kuyper@wizard.net (James
Kuyper) wrote:
> I@ddmrm.com ("DEX") wrote in message news:<2ggunsF2lnpsU1@uni-berlin.de>...
> > English version.
> > If container has forward and reverse iterator does it mean that container
> > must have bi-directional iterator.
> There's no such requirement.
Did you consider table 66?
> If Container::reverse_iterator is typedefd as
> std::reverse_iterator<Container::iterator>, then Container::iterator
> must be bidirectional (24.1.4).
Table 66 gives no choice. If it is a reversible container, that typedef
is required.
John
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: mail@qWake.com ("qWake")
Date: Sun, 16 May 2004 01:31:27 +0000 (UTC) Raw View
"James Kuyper" <kuyper@wizard.net> wrote in message
> As a practical matter, I can't come up with a good reason why anyone
> would implement a container with both forward and reverse iterators,
> yet not provide a bidirectional iterator.
To prevent items from being processed more than once?
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: I@ddmrm.com ("DEX")
Date: Thu, 13 May 2004 15:13:04 +0000 (UTC) Raw View
English version.
If container has forward and reverse iterator does it mean that container
must have bi-directional iterator.
Example:
1. std::vector have forward, reverse and bidirectional.
2. std::list have forward, reverse and bidirectional.
--
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]