goodbit stream state

J

john

Erik said:
Yes, but it does not fulfil the requirements of a container (the
concept), one of which is to provide iterators.


I am not sure it should provide iterators to be considered a container.
"list" does not provide subscripting and is a container.

Just to confuse people
even more it is described under section 23.3 Associative Containers.


In any case, also in TC++PL3 "bitset" is described in Chapter 17
(17.5.3), which is titled: "Standard Containers", together with the
other containers.
 
P

Pete Becker

I am not sure it should provide iterators to be considered a container.
"list" does not provide subscripting and is a container.

Some iterators do not support subscripting. Containers are used to
create sequences, and sequences are accessed through iterators. That
is, containers by defininition provide iterators.
 
G

Guest

I am not sure it should provide iterators to be considered a container.
"list" does not provide subscripting and is a container.

A container needs to provide begin() and end() in addition to a number
of other requirements described in Table 65 of the standard. The
subscript operator is optional for sequential containers and should be
provided only if it can be performed in constant time. Not to be
confused with associative containers like std::map, which does not have
any requirements for a subscript operator.

I would suspect that if the concepts proposition is included in the next
standard there will be a Container concept.
 
J

john

Erik said:
A container needs to provide begin() and end() in addition to a number
of other requirements described in Table 65 of the standard.


Built in arrays do not provide begin() and end(), and I think valarray
doesn't provide either, but I think both are considered containers.
 
P

Pete Becker

Built in arrays do not provide begin() and end(), and I think valarray
doesn't provide either, but I think both are considered containers.

They're not containers. Containers, by definition, provide iterators to
their contents.
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top