Virtual & Pure virtual destructors

This is a discussion on Virtual & Pure virtual destructors within the C++ Programming forums, part of the General Programming Boards category; "the normal way" that you posted is a virtual destructor. Not a pure virtual destructor....

  1. #46
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    "the normal way" that you posted is a virtual destructor. Not a pure virtual destructor.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  2. #47
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Okay, so a pure virtual destructor is used only when you have an abstract base class with no methods.

  3. #48
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    yeah sort of, it seems kind of wierd. you would do it if you had no other pure virtual methods in it but still wanted to make your class abstract. You COULD have other methods in there though. I can not imagine a circumstance where this would be necessary. For "interfaces" you would normally have other pure virtual and no destructors so they don't apply. But it's there in the language if you ever want it.

    ho hum
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #49
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    It sounds like it's there for little guys, or guys with little penises.

  5. #50
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    interesting perspective

  6. #51
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Most guys wouldn't even know about this language feature. That's all I'm saying.

  7. #52
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    ya, but I strive to be an expert C++ coder and in doing so I think an "expert" should know everything possible about the language, even the obscure.

  8. #53
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >I think an "expert" should know everything possible about the language, even the obscure
    An expert doesn't know 'everything' in most cases. I see an expert as someone who is capable of dealing with a wide variety of problems because they know where to find the answer, not because they memorized it. Knowing how to use the more common features of a language well is more important than knowing about obcure features and never using them.

    -Prelude
    My best code is written with the delete key.

  9. #54
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    lol

  10. #55
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    well prelude, you can get through the language and accomplish most things pretty well with just the basics. That doesn't mean your an expert. notice also that I said "everything possible" and not "everything" the way you quoted me. I admire C++ and wish to know everything I can. is that somehow wrong? Anyhow, I was not the thread starter.

  11. #56
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Get a real compiler so that you can run the code in the books.

  12. #57
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >That doesn't mean your an expert.
    The definition of an expert is and always has been up for debate. There is a big difference between writing a program with the basic language and writing it well.

    >notice also that I said "everything possible" and not "everything" the way you quoted me.
    I wasn't aware that knowledge was denied some people. I read 'everything possible' and 'everything' as equivalent because if I had my way, everything possible would be everything. You don't seem to be any different, hence my interpretation of your statement.

    >is that somehow wrong?
    Not at all, I'm sorry if I gave you that impression.

    -Prelude
    My best code is written with the delete key.

  13. #58
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Originally posted by Troll_King
    Get a real compiler so that you can run the code in the books.
    the code in the books? seems to all be running fine for me. Nothing wrong with VC++. Standard compliant or not it does the job.

  14. #59
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    not sure how this thread turned into an argument prelude, I thought it was a very interesting topic, that's all.

  15. #60
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    I'll just assume that this whole issue is a 'supported, but not often used' kinda thing

Page 4 of 5 FirstFirst 12345 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 10-28-2009, 10:25 AM
  2. Replies: 48
    Last Post: 09-26-2008, 04:45 AM
  3. Information Regarding Pure Virtual Functions
    By shiv_tech_quest in forum C++ Programming
    Replies: 6
    Last Post: 01-29-2003, 04:43 AM
  4. C++ XML Class
    By edwardtisdale in forum C++ Programming
    Replies: 0
    Last Post: 12-10-2001, 11:14 PM
  5. virtual or pure virtual
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-01-2001, 07:19 PM

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