home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.cerf.net!nic.cerf.net!hlf
- From: hlf@nic.cerf.net (Howard Ferguson)
- Newsgroups: comp.lang.c++
- Subject: Preventing inheritance
- Date: 11 Jan 1993 04:40:25 GMT
- Organization: CERFnet Dial n' CERF Customer Group
- Lines: 10
- Message-ID: <1iqtnpINN283@news.cerf.net>
- NNTP-Posting-Host: nic.cerf.net
-
-
- If I create a class which I am supplying to other users, how do I
- make sure that they do not inherit from it ever. I could overload new
- and check the size of the object that is being allocated, but there
- are two catchs. The first minor one is that this is a run-time check,
- and it would be far preferable to catch this sort of thing at compile
- time. More seriously, they could over-ride the new operator and by-pass
- the check.
- yours totally paranoid,
- hlf
-