Thread: delete zero out its operand

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    delete zero out its operand

    Hello everyone,


    A little confused after reading C++ FAQ, "Why doesn't delete zero out its operand?"

    http://www.research.att.com/~bs/bs_f...ml#delete-zero

    I think the reason why delete can not zero out its operand is because delete can be operate on rvalue, like

    delete f(x);

    And we can not assign zero to the rvalue (i.e. delete's operand). My understanding correct?


    thanks in advance,
    George

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Yes, that's the primary reason why it's not possible for delete to zero out its operand.
    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

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Thanks CornedBee,


    Question answered.

    Quote Originally Posted by CornedBee View Post
    Yes, that's the primary reason why it's not possible for delete to zero out its operand.

    regards,
    George

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BST delete again, but this time I think I'm close
    By tms43 in forum C++ Programming
    Replies: 9
    Last Post: 11-05-2006, 06:24 PM
  2. delete and delete []
    By Lionel in forum C++ Programming
    Replies: 8
    Last Post: 05-19-2005, 01:52 PM
  3. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  4. why is this prog crashing on delete?
    By Waldo2k2 in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 11:17 PM
  5. Problem need help
    By Srpurdy in forum C++ Programming
    Replies: 1
    Last Post: 07-24-2002, 12:45 PM