unsure about auto/smart pointers

This is a discussion on unsure about auto/smart pointers within the C++ Programming forums, part of the General Programming Boards category; Im afraid I cant. What will be different in C++09?...

  1. #16
    l2u
    l2u is offline
    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,317
    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.

Page 2 of 2 FirstFirst 12
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, 09:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 12:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21