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. Advertising

  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. Advertising

  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. 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. Replies:
    3
    Views:
    809
    MattC
    Jan 14, 2005
  2. Alex Pavloff
    Replies:
    1
    Views:
    2,000
    Victor Bazarov
    May 10, 2005
  3. D Yuniskis

    Preprocessor limitation workarounds

    D Yuniskis, Nov 22, 2009, in forum: C Programming
    Replies:
    32
    Views:
    1,116
    D Yuniskis
    Nov 26, 2009
  4. jason
    Replies:
    2
    Views:
    191
    jason
    Aug 7, 2003
  5. liquid_rails
    Replies:
    11
    Views:
    212
    Michal Suchanek
    Jul 2, 2008
Loading...

Share This Page