Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: Map C++ feature to C |
| Date | 2012-06-25 10:15 +1200 |
| Message-ID | <a4phrcFaukU2@mid.individual.net> (permalink) |
| References | <js6ip6$qb1$1@speranza.aioe.org> <a4o4ojFe9mU2@mid.individual.net> <js7n1a$buh$1@news.albasani.net> |
On 06/25/12 06:39 AM, BGB wrote: > On 6/24/2012 4:25 AM, Ian Collins wrote: >> On 06/24/12 08:23 PM, zgene wrote: >>> Dear friends >> >> Why is the question completely different form the subject? >> >>> Is there a way to embulate C++'s virtual destructors in pure C. IE just >>> using function pointers. >> >> No, because there isn't a way to fully emulate destructors. >> > > strictly speaking, yes. > > but if one allows for the case where the destructor is called via the > object being manually destroyed/"deleted", then it becomes a little > easier: just have it as a method/function-pointer which is called prior > to freeing the memory. A "little" easier is the appropriate term. The OP asked for virtual destructor functionality, which requires some form of virtual dispatch mechanism. Doable, but ugly. -- Ian Collins
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Map C++ feature to C zgene <nospam@nospam.com> - 2012-06-24 08:23 +0000
Re: Map C++ feature to C Ian Collins <ian-news@hotmail.com> - 2012-06-24 21:25 +1200
Re: Map C++ feature to C BGB <cr88192@hotmail.com> - 2012-06-24 13:39 -0500
Re: Map C++ feature to C Ian Collins <ian-news@hotmail.com> - 2012-06-25 10:15 +1200
Re: Map C++ feature to C BGB <cr88192@hotmail.com> - 2012-06-25 11:32 -0500
Re: Map C++ feature to C zgene <nospam@nospam.com> - 2012-06-24 21:33 +0000
Re: Map C++ feature to C Ian Collins <ian-news@hotmail.com> - 2012-06-25 10:12 +1200
Re: Map C++ feature to C William Ahern <william@wilbur.25thandClement.com> - 2012-06-24 18:49 -0700
Re: Map C++ feature to C nroberts <roberts.noah@gmail.com> - 2012-07-23 10:25 -0700
Re: Map C++ feature to C Andrew Cooper <amc96@cam.ac.uk> - 2012-07-24 01:34 +0100
Re: Map C++ feature to C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-07-24 15:58 +0000
Re: Map C++ feature to C "christian.bau" <christian.bau@cbau.wanadoo.co.uk> - 2012-06-24 11:36 -0700
Re: Map C++ feature to C Leo Havmøller <rtxleh@nospam.nospam> - 2012-06-25 05:43 +0200
Re: Map C++ feature to C Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-06-25 10:34 +0000
Re: Map C++ feature to C BGB <cr88192@hotmail.com> - 2012-06-25 11:36 -0500
Re: Map C++ feature to C Paul N <gw7rib@aol.com> - 2012-06-24 12:19 -0700
Re: Map C++ feature to C 88888 Dihedral <dihedral88888@googlemail.com> - 2012-06-24 19:49 -0700
Re: Map C++ feature to C aftnix <aftnix@gmail.com> - 2012-07-26 13:36 -0700
csiph-web