cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
abstract class and interface classes
abstract class and interface classes
Nov 29, 2021 at 10:06pm UTC
closed account (
j8Mo2yTq
)
When declaring an interface using pure virtual functions is it normal or suggested to declare the destructor as virtual too or is it not usually done with interface classes.
Nov 30, 2021 at 12:54am UTC
JLBorges
(13770)
See:
A class with a virtual function should have a virtual or protected destructor
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-dtor
and
A polymorphic class should suppress public copy/move
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rc-copy-virtual
Nov 30, 2021 at 2:06am UTC
closed account (
j8Mo2yTq
)
Thanks for the link. It looks like a good source of information.That will keep me busy for awhile going through that.
Topic archived. No new replies allowed.