Article View: gnu.g++
Article #255extern versus abstract functions
From: kenny
Date: Wed, 24 Jan 1990 08:13
Date: Wed, 24 Jan 1990 08:13
32 lines
1274 bytes
1274 bytes
If I have a class with abstract virtual functions, as in
class foo {
char bar;
public:
virtual void do_something () const = 0;
};
I can't declare an extern variable belonging to that class:
extern foo zot;
The reason I want to do this is that I'm creating zot in another .cc
file with:
class quux : public foo {
public:
void do_something ();
} zot;
with the virtual function supplied; I just want to hide zot's derived
class from the users of foo. (This is primarily for expandability --
I want to be able to derive new classes from foo without having to
recompile the whole world).
It seems to me that there's no problem with accepting the extern
declaration; the compiler isn't actually constructing an instance of
foo, as it would if the `extern' keyword were not supplied. Am I
missing something?
Kevin KE9TV
Technical Details
Message-ID:
<52100006@m.cs.uiuc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!iuvax!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!kennyShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!purdue!iuvax!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!kenny From: kenny@m.cs.uiuc.edu Newsgroups: gnu.g++ Subject: extern versus abstract functions Message-ID: <52100006@m.cs.uiuc.edu> Date: 24 Jan 90 08:13:00 GMT Lines: 32 Nf-ID: #N:m.cs.uiuc.edu:52100006:000:826 Nf-From: m.cs.uiuc.edu!kenny Jan 24 02:13:00 1990