What are Containers/Adapters? C++

前端 未结 3 393
别那么骄傲
别那么骄傲 2020-12-07 09:00

What are containers/adapters? I have basic knowledge of C++ and its sub-topics like (class/templates/STL).

Can anyone please explain in layman\'s language and give me

3条回答
  •  情话喂你
    2020-12-07 09:53

    C++ is technical and hard to understand :-D

    Containers are data types from STL that can contain data.

    Example: vector as a dynamic array

    Adapters are data types from STL that adapt a container to provide specific interface.

    Example: stack providing stack interface on top of the chosen container

    (side note: both are actually templates not data types, but the definition looks better this way)

提交回复
热议问题