How are STL Map stored in memory?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Shilpa Sethi
    New Member
    • Aug 2010
    • 12

    How are STL Map stored in memory?

    How are STL Map stored in memory?
    i.e. they are stored in continuous memory like array or stored in a list or like a deque i.e in pages or in binary tree?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    None of your concern.

    I idea behind encapsulation is that you cannot see the implementation. Because of that you can't make assumptions about the implementation and then put those assumptions into your code.

    The templates are in the <map> include file and you can examine them there.

    There is no requirement by the C++ standard that a <map> has to have a specific memory management plan. Therefore, each author of STL templates can have different implementations . That is why I suggest you look at your own templates.

    Comment

    Working...