Delete and vector pointer

This is a discussion on Delete and vector pointer within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by Elysia If it's too slow when looking at a profiler, then I will consider changing it. Funny ...

  1. #16
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,239
    Quote Originally Posted by Elysia View Post
    If it's too slow when looking at a profiler, then I will consider changing it.
    Funny how you apply this argument here. I would suggest the exact same thing but in reverse. Return by value, and profile it to make sure it's not being "stupid."

    It took me a long, long time to realize that pointers suck. Maybe there is hope for you.

  2. #17
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,538
    Pointers suck when not wrapped in smart pointers
    That's my experience. Most of the "access violation" I get is with complex, non-C++ish code, such as managing buffers and pointers by hand (which I do avoid).
    Mostly it's old code, written many years ago or so. We improve all the time!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,598
    No, I do believe it can do it, but I don't know how or when.
    This may be applicable to you, though it pertains to the 2005 version of Visual C++:
    Named Return Value Optimization in Visual C++ 2005
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #19
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by Elysia View Post
    Pointers suck when not wrapped in smart pointers
    They suck even then. Just a tiny bit less. Value semantics rule.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

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