Thread: unsure about auto/smart pointers

  1. #16
    Registered User
    Join Date
    May 2006
    Posts
    630
    Im afraid I cant. What will be different in C++09?

  2. #17
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    A couple things related to this. There's a thread about it in the General Discussions area. Basically it will be easier to move objects rather than copy them. So something heavyweight like a vector can be stored in another container with fewer efficiency issues. Instead of the heavyweight object getting copied everywhere, it gets moved. I was just kidding about waiting until then, though.

    Another note about your previous question- If the parser really has a short lifetime like in your example, then you might be able to pass the vector into the parse function by reference. In that case you won't need to do any copies because you can get the vector directly from the map:
    Code:
    parser p;
    p.parse(my_cache.map_[key_string]);
    Last edited by Daved; 07-13-2007 at 12:57 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MergeSort with array of pointers
    By lionheart in forum C Programming
    Replies: 18
    Last Post: 08-01-2008, 10:23 AM
  2. Using pointers to pointers
    By steve1_rm in forum C Programming
    Replies: 18
    Last Post: 05-29-2008, 05:59 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 01:18 PM