You should never call a virtual function in a base constructor or destructor.
If your compiler is nice, it will generate code that will tell you this. Otherwise, I maybe hard to debug. Indirect calls to virtual functions add another layer of difficulty to debugging.
References:
More Exceptional C++ by Herb Sutter. Addison-Wesley, 2002., p. 170.
http://www.artima.com/cppsource/pure_virtual.html
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment