id 57, svdb 2698 _____ YES __X__ No http://www.eda.org/svdb/view.php?id=2698 [Alsop, Thomas R] I am not convinced that 'pure' is required in order to create what is coined a "pure virtual method'. It's really ambiguous and seems like you can create a prototype virtual method and any level of abstract class hierarchy and only be forced to override it when you extend it to a non-abstract class and hence create the object out of it. I guess I am asking what the intent behind the 'pure' keyword is? If an abstract class at any level only prototypes a method, does that mean we have to label it 'pure'. [DR] No. an abstract class does not need to contain pure virtual methods, but a pure virtual method can only be contained in an abstract class. The "pure" keyword does two things: It says what follows is a prototype with no implementation, just like what "extern" does. However, the extern keyword requires that you provide an implementation (a body) that becomes part of the class definition, regardless of whether the method is virtual or not, or whether the class is abstract or not. The other thing the pure keyword does is say that I'm not providing an implementation in this abstract class, creating a requirement that someone provide an implementation in the form of an override in an extended class before you can construct a non-abstract class object. Dave -- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/> , and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner <http://www.mailscanner.info/> , and is believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Tue Apr 28 22:31:41 2009
This archive was generated by hypermail 2.1.8 : Tue Apr 28 2009 - 22:32:28 PDT