Thread: Unordered map behavior on clear and reserve

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    main() provides a scope. When main() returns, your map passes out of scope and its destructor is invoked. It's actions are included in the statistics reported by valgrind.

    The details of the particular numbers depends on the implementation of insert() - and other functions related to unordered_map
    Last edited by grumpy; 01-01-2015 at 12:55 AM.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. implementing with map, and unordered map
    By jaesungj in forum C++ Programming
    Replies: 0
    Last Post: 11-08-2013, 09:45 AM
  2. Replies: 5
    Last Post: 06-30-2011, 10:29 PM
  3. capacity and reserve
    By George2 in forum C++ Programming
    Replies: 33
    Last Post: 03-06-2008, 08:14 PM
  4. Reserve the character in a string
    By alice in forum C Programming
    Replies: 2
    Last Post: 06-13-2004, 07:59 AM