Re: inhibit compiler warning C4624 for a class hierarchy
- From: "Alex Blekhman" <xfkt@xxxxxxxxx>
- Date: Wed, 10 Jan 2007 10:59:36 +0200
"Heinz Ozwirk" wrote:
You can make destructor protected, so it will be
availabale for derived classes while unavailable for
outside users of a class.
Additionally the destructors of all derived classes should
then be protected, too. If one of the derived classes had
a public destructor, instances of that class could be
created on the "stack" without error or even a warning.
Unavailable destructor issue has been discussed recently in
this group. Such code passes compilation only because of MS
extension being applied. Actually, it should be an error,
not a warning. Also, I believe that warning of level 1
shouldn't be treated as anything else than error.
Making an object to be uncreatable on stack is quite
uncommon requirement. So, protected destructor throughout an
hierarchy is acceptable price for it.
Alex
.
- Follow-Ups:
- Re: inhibit compiler warning C4624 for a class hierarchy
- From: Ben Voigt
- Re: inhibit compiler warning C4624 for a class hierarchy
- References:
- inhibit compiler warning C4624 for a class hierarchy
- From: Ben Voigt
- Re: inhibit compiler warning C4624 for a class hierarchy
- From: Alex Blekhman
- Re: inhibit compiler warning C4624 for a class hierarchy
- From: Heinz Ozwirk
- inhibit compiler warning C4624 for a class hierarchy
- Prev by Date: Re: What is the best IPC mechanic?
- Next by Date: Re: Driver Development with Visual C++ for PcVue
- Previous by thread: Re: inhibit compiler warning C4624 for a class hierarchy
- Next by thread: Re: inhibit compiler warning C4624 for a class hierarchy
- Index(es):
Relevant Pages
|