Standard interface for containers?

Discussion in 'C++' started by saneman, Jan 28, 2008.

  1. saneman

    saneman Guest

    C++ contains the following containers:

    - Vector
    - List
    - Dequeue
    - Queue
    - Stack
    - Map
    - Set
    - Bitset


    Is there a single common interface for all these containers or do they
    each implement their own interface?
     
    saneman, Jan 28, 2008
    #1
    1. Advertising

  2. saneman a écrit :
    > C++ contains the following containers:
    >
    > - Vector
    > - List
    > - Dequeue
    > - Queue
    > - Stack
    > - Map
    > - Set
    > - Bitset
    >
    >
    > Is there a single common interface for all these containers or do they
    > each implement their own interface?


    They implement different concept ("Back insertion Container",
    "Associative container" ...) to which correspond specific interface.

    Please, refer to SGI STL for comprehensive reading.
    http://www.sgi.com/tech/stl/

    Michael
     
    Michael DOUBEZ, Jan 28, 2008
    #2
    1. Advertising

  3. saneman

    saneman Guest

    Michael DOUBEZ wrote:
    > saneman a écrit :
    >> C++ contains the following containers:
    >>
    >> - Vector
    >> - List
    >> - Dequeue
    >> - Queue
    >> - Stack
    >> - Map
    >> - Set
    >> - Bitset
    >>
    >>
    >> Is there a single common interface for all these containers or do they
    >> each implement their own interface?

    >
    > They implement different concept ("Back insertion Container",
    > "Associative container" ...) to which correspond specific interface.
    >
    > Please, refer to SGI STL for comprehensive reading.
    > http://www.sgi.com/tech/stl/
    >
    > Michael


    Ok but in the C++ Standard it seems that there is some basic requirement
    that all containers must fulfill. In section 23.1 table 65 these
    requirements are listed.

    So would it be correct to say that table 65 works as a basic interface
    for associative containers and sequences (but not adaptors)?

    Adaptors as I understand is a subset of sequences that not necessary
    fulfill all container or sequence requirements.
     
    saneman, Jan 28, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gandalf
    Replies:
    6
    Views:
    356
    Gandalf
    Oct 17, 2003
  2. SpOiLeR
    Replies:
    0
    Views:
    386
    SpOiLeR
    Feb 21, 2005
  3. Gregory
    Replies:
    8
    Views:
    802
    Neil Cerutti
    Nov 18, 2005
  4. Replies:
    7
    Views:
    561
    Pete Becker
    Jan 25, 2008
  5. Sebastian Mach
    Replies:
    5
    Views:
    328
Loading...

Share This Page