C++ and m/c/realloc with Native Types

This is a discussion on C++ and m/c/realloc with Native Types within the C++ Programming forums, part of the General Programming Boards category; Just being thorough. And more importantly, answering the original poster's question. I have had to do this before so I ...

  1. #16
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Just being thorough. And more importantly, answering the original poster's question. I have had to do this before so I can see where he may be stuck with using the exception to the rule.

  2. #17
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,632
    Quote Originally Posted by master5001
    I hope someone brought up the placement new operator at some point.
    Yes, I did, on post #9, but I noted that it is only suitable when hidden behind the class (template) interface.

    Quote Originally Posted by matsp
    Yes, but that is REALLY not a good idea except in very special cases.
    One common "special case" would be to avoid unnecessary default initialisation of objects.
    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

  3. #18
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Thanks laserlight. I figured surely someone would have by now. I hope everyone picked on your equally for bringing it up. Though I think I just attract negative attention for you guys (thanks everyone, I love you all--really).

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