multimap insert survey

Discussion in 'C++' started by Howard Hinnant, Apr 21, 2005.

  1. I recently asked for a survey of multimap insert with hint behavior, in
    support of a paper I'm writing concerning lwg issue 233. My sincere
    thanks to Beman Dawes, Raoul Gough, Russell Hind, Bronek Kozicki, Nicola
    Musatti, John Potter and Maxim Yegorushkin for helping with that survey.

    Since I started work on this paper at least two people I respect very
    much have expressed interest in nailing down the "insert without hint"
    function a little better. And so in the interest of addressing this
    concern, I would like to conduct yet another survey. And thanks again
    for any assistance you can provide. I would like to know what the
    following program produces for various std::lib implementations:

    #include <map>
    #include <string>
    #include <iostream>
    #include <utility>

    template <class Map>
    void
    display(const Map& m)
    {
    for (typename Map::const_iterator i = m.begin(), e = m.end(); i !=
    e; ++i)
    std::cout << '(' << i->first << ", " << i->second << ") ";
    std::cout << '\n';
    }

    int main()
    {
    typedef std::multimap<int, std::string> Map;
    typedef std::pair<int, std::string> value_type;
    Map m;
    m.insert(value_type(3, "three"));
    m.insert(value_type(3, "threE"));
    m.insert(value_type(3, "thrEe"));
    m.insert(value_type(3, "thrEE"));
    m.insert(value_type(3, "thRee"));
    m.insert(value_type(3, "thReE"));
    m.insert(value_type(3, "thREe"));
    m.insert(value_type(3, "thREE"));
    m.insert(value_type(3, "tHree"));
    m.insert(value_type(3, "tHreE"));
    m.insert(value_type(3, "tHrEe"));
    m.insert(value_type(3, "tHrEE"));
    m.insert(value_type(3, "tHRee"));
    m.insert(value_type(3, "tHReE"));
    m.insert(value_type(3, "tHREe"));
    m.insert(value_type(3, "tHREE"));
    m.insert(value_type(3, "Three"));
    m.insert(value_type(3, "ThreE"));
    m.insert(value_type(3, "ThrEe"));
    m.insert(value_type(3, "ThrEE"));
    m.insert(value_type(3, "ThRee"));
    m.insert(value_type(3, "ThReE"));
    m.insert(value_type(3, "ThREe"));
    m.insert(value_type(3, "ThREE"));
    m.insert(value_type(3, "THree"));
    m.insert(value_type(3, "THreE"));
    m.insert(value_type(3, "THrEe"));
    m.insert(value_type(3, "THrEE"));
    m.insert(value_type(3, "THRee"));
    m.insert(value_type(3, "THReE"));
    m.insert(value_type(3, "THREe"));
    m.insert(value_type(3, "THREE"));
    display(m);
    }

    Metrowerks produces:

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE) (3,
    thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE) (3, tHRee)
    (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE) (3, ThrEe) (3,
    ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE) (3, THree) (3, THreE)
    (3, THrEe) (3, THrEE) (3, THRee) (3, THReE) (3, THREe) (3, THREE)

    Thanks,
    Howard
     
    Howard Hinnant, Apr 21, 2005
    #1
    1. Advertising

  2. Howard Hinnant

    Jerry Coffin Guest

    Howard Hinnant wrote:

    [ ... ]

    > I would like to know what the following program produces for various
    > std::lib implementations:


    [ code elided ... ]

    VC++ 7.1 stock library:

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE)
    (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE)
    (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE)
    (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE)
    (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE)
    (3, THREe) (3, THREE)

    VC++ 8.0 Beta 1 stock library:

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE)
    (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE)
    (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE)
    (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE)
    (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE)
    (3, THREe) (3, THREE)

    libcomo V31 (with Comaeu 4.3.3):

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE)
    (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE)
    (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE)
    (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE)
    (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE)
    (3, THREe) (3, THREE)

    The stock library for Borland C++ 5.5:

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE)
    (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE)
    (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE)
    (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE)
    (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE)
    (3, THREe) (3, THREE)

    STLPort 4.5.3 (with BCC 5.5):

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE)
    (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE)
    (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE)
    (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE)
    (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE)
    (3, THREe) (3, THREE)

    The stock library for MinGW 3.4.2:

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE)
    (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE)
    (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE)
    (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE)
    (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE)
    (3, THREe) (3, THREE)

    --
    Later,
    Jerry.

    The universe is a figment of its own imagination.
     
    Jerry Coffin, Apr 21, 2005
    #2
    1. Advertising

  3. In article <>,
    Howard Hinnant <> wrote:
    > Metrowerks produces:
    >
    > (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE) (3,
    > thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE) (3, tHRee)
    > (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE) (3, ThrEe) (3,
    > ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE) (3, THree) (3, THreE)
    > (3, THrEe) (3, THrEE) (3, THRee) (3, THReE) (3, THREe) (3, THREE)


    Sun Studio 10, compiled with -library=stlport4 produces:

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE) (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE) (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE) (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE) (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE) (3, THREe) (3, THREE)
     
    Guy Middleton, Apr 21, 2005
    #3
  4. Howard Hinnant wrote:
    <snip>
    > for any assistance you can provide. I would like to know what the
    > following program produces for various std::lib implementations:

    <snip>

    Linux (SuSE Pro v9.2 32 bit)
    GNU g++ (GCC) 3.3.4 (pre 3.3.5 20040809)
    GNU libstdc++-3.3.4-11

    (3, three) (3, threE) (3, thrEe) (3, thrEE) (3, thRee) (3, thReE)
    (3, thREe) (3, thREE) (3, tHree) (3, tHreE) (3, tHrEe) (3, tHrEE)
    (3, tHRee) (3, tHReE) (3, tHREe) (3, tHREE) (3, Three) (3, ThreE)
    (3, ThrEe) (3, ThrEE) (3, ThRee) (3, ThReE) (3, ThREe) (3, ThREE)
    (3, THree) (3, THreE) (3, THrEe) (3, THrEE) (3, THRee) (3, THReE)
    (3, THREe) (3, THREE)

    Regards,
    Larry

    --
    Anti-spam address, change each 'X' to '.' to reply directly.
     
    Larry I Smith, Apr 21, 2005
    #4
    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. Håvard Kverneland

    Multimap

    Håvard Kverneland, Feb 10, 2004, in forum: Java
    Replies:
    1
    Views:
    676
    Håvard Kverneland
    Feb 10, 2004
  2. John Harrison
    Replies:
    1
    Views:
    602
    Dave O'Hearn
    Aug 14, 2003
  3. Nick Keighley
    Replies:
    4
    Views:
    796
    Carlos Martinez Garcia
    Jan 23, 2006
  4. reppisch
    Replies:
    6
    Views:
    1,022
    reppisch
    Jun 19, 2007
  5. hurcan solter

    multimap insert behaviour with a hint

    hurcan solter, Feb 23, 2009, in forum: C++
    Replies:
    1
    Views:
    678
Loading...

Share This Page