CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003
    Location
    kathmandu, nepal
    Posts
    1,570

    std::map weird problem

    Hi all,

    Is there a way to know if a particular key exists or not?

    I use a pointer to a very very big object as the value for std::map.

    If I call std::map's insert function then I have to allocate that large object.

    If the key already exists I want to avoid allocating that large object and avoid insert altogether.

    Please help. Thanks in advance
    If there is no love sun won't shine

  2. #2
    Join Date
    Apr 2003
    Location
    kathmandu, nepal
    Posts
    1,570

    Re: std::map weird problem

    What was I thinking there is indeed the "find" function that I can use
    If there is no love sun won't shine

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured