samedi 6 juin 2020

Sequence Containers - why a few expressions are only supported by a few sequence containers

I was going thru Sequence Containers named requirement : https://en.cppreference.com/w/cpp/named_req/SequenceContainer

But then it states that the following expressions must be valid and have their specified effects for the sequence containers named:

example:

seqcnt.pop_front()               Destroys the first element.                        deque / list / forward_list
seqcnt.pop_back()                Destroys the last element                          deque / list / vector

Why are all expressions not supported by all sequence containers?

Aucun commentaire:

Enregistrer un commentaire