What's the different between std::multimap<key, value> and

Discussion in 'C++' started by fish, Dec 22, 2011.

  1. fish

    fish Guest

    I found that they have one key and multiple values which is unique.
    Anyone supplement?
     
    fish, Dec 22, 2011
    #1
    1. Advertising

  2. fish

    fish Guest

    On 12月22æ—¥, 下åˆ8æ—¶05分, Sam <> wrote:
    > fish writes:
    > > I found that they have one key and multiple values which is unique.
    > > Anyone supplement?

    >
    > Well, aside from the different layout, std::set<value> enforces the
    > uniqueness of the value type, while the multimap may have multiple instances
    > of value. So, multiple instances of a value would have to be stored in
    > different multimap entries.
    >
    > A more closer analogue to std::multimap<key, value> would be a std::map<key,
    > std::multiset<value> >.
    >
    >  application_pgp-signature_part
    > < 1K查看下载


    Thanks!
     
    fish, Dec 23, 2011
    #2
    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. Tanguy Fautré

    std::multimap insertion order guarantees

    Tanguy Fautré, Oct 5, 2003, in forum: C++
    Replies:
    13
    Views:
    822
    David B. Held
    Oct 6, 2003
  2. He Shiming
    Replies:
    3
    Views:
    3,835
    He Shiming
    Dec 26, 2004
  3. PeteOlcott

    std::multimap with composite key?

    PeteOlcott, Jan 19, 2009, in forum: C++
    Replies:
    5
    Views:
    3,279
    Daniel T.
    Jan 22, 2009
  4. Victor Bazarov
    Replies:
    15
    Views:
    1,186
    Vaclav Haisman
    Aug 16, 2009
  5. Rui Maciel

    Multimap: how to get a key list?

    Rui Maciel, Feb 28, 2010, in forum: C++
    Replies:
    7
    Views:
    3,270
    Michael Doubez
    Mar 4, 2010
Loading...

Share This Page