STL: Map of maps possible, but no multi-map of maps? Workarounds?

Discussion in 'C++' started by Marcus, Dec 9, 2005.

  1. Marcus

    Marcus Guest

    It's possible to do this:

    map<double, map <string, int> > foo;

    but not this or any other nested variant using multimap:

    multimap<double, map <string, int> > foo;

    Any known (or unknown) workarounds?

    Thanks
    Marcus
     
    Marcus, Dec 9, 2005
    #1
    1. Advertisements

  2. Marcus wrote:
    > It's possible to do this:
    >
    > map<double, map <string, int> > foo;
    >
    > but not this or any other nested variant using multimap:
    >
    > multimap<double, map <string, int> > foo;


    Works with comeau online 4.3.3, also with g++ 3.4.2
     
    Neelesh Bodas, Dec 9, 2005
    #2
    1. Advertisements

  3. Marcus

    Marcus Guest

    hmmm... you're right, i must have a bug somewhere. glad to know it
    works.

    thanks for checking that.
     
    Marcus, Dec 9, 2005
    #3
    1. Advertisements

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. Replies:
    3
    Views:
    1,011
    MattC
    Jan 14, 2005
  2. Vlad
    Replies:
    0
    Views:
    521
  3. Alex Pavloff
    Replies:
    1
    Views:
    2,095
    Victor Bazarov
    May 10, 2005
  4. Replies:
    2
    Views:
    709
    klaus hoffmann
    Feb 22, 2006
  5. D Yuniskis

    Preprocessor limitation workarounds

    D Yuniskis, Nov 22, 2009, in forum: C Programming
    Replies:
    32
    Views:
    1,324
    D Yuniskis
    Nov 26, 2009
  6. jason
    Replies:
    2
    Views:
    283
    jason
    Aug 7, 2003
  7. ittium
    Replies:
    4
    Views:
    517
    ittium
    Dec 8, 2011
  8. Luca Risolia

    STL map to STL vector

    Luca Risolia, Jan 13, 2014, in forum: C++
    Replies:
    32
    Views:
    824
    Seungbeom Kim
    Jan 18, 2014
Loading...