jeudi 23 juillet 2020

Sequence containers - why all containers do not all methods

I was learning C++ Sequence containers by referring below information - https://en.cppreference.com/w/cpp/container [Member function table - functions present in C++03 ,- functions present since C++11, - functions present since C++17, - functions present since C++20] available at the end of the page.

What I am unable to understand reasons why all sequence containers support at least if not all basic methods like:

forward_list does not supports size()
vectors does not support emplace_front()
arrays does not support capacity()
deque does not supports reserve()
list does not supports emplace_hint()

Similarly there are other features which are available in all? Basically what features or functionality decides which method is available for one container and not for other?

Aucun commentaire:

Enregistrer un commentaire