Question for C++ Experts

Dimitry Andric dimitry at andric.com
Mon Jul 26 13:09:48 PDT 2004


On 2004-07-26 at 21:55:32 Ryan Sommers wrote:

> The problem I am running into is that it seems to be illegal to call
> a pure virtual function from an abstract base contructor.

This is because you shouldn't call virtual functions from
constructors, unless you know what you're doing. :)

Try using exceptions, or two-phase initialization.  And read a C++ FAQ
for more info, i.e.:

http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.3

There's lots more in there, also explaining your other questions. But
this is quite offtopic for this list...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 183 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20040726/01dd2d66/attachment.bin


More information about the freebsd-hackers mailing list