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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top