1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Returning object by value or smart pointer

Discussion in 'C++' started by mrpringle, Aug 31, 2010.

  1. mrpringle

    mrpringle New Member

    Aug 31, 2010
    Likes Received:
    Trophy Points:
    If I had the following two options, which would be more desirable or generally accepted.

    1. Creating an object on the stack and returning it by value.
    2. Creating an object on the heap, storing it in an auto ptr and returning the auto ptr.

Share This Page