
Well, that's true for exception_detail, but error_info has a public non-virtual destructor and might be used as a base class (I am sure it isn't, but when I just have a quick look at it when coding it doesn't say that it shouldn't). Best regards, Jens
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Steven Watanabe Sent: Thursday, March 17, 2011 5:37 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] boost::exception_detail::error_info_base does not have virtual destructor
AMDG
On 03/17/2011 08:50 AM, Jens Auer wrote:
I am compiling a project with a more strict warning set and got the following reports: Error 29 error C4265: 'boost::exception_detail::error_info_base' : class has virtual functions, but destructor is not virtual c:\work\svn\sandbox\externals\boost\include\boost-1_45\boost\e xception\detail\error_info_impl.hpp 36
Error 30 error C4265: 'boost::error_info
' : class has virtual functions, but destructor is not virtual c:\work\svn\sandbox\externals\boost\include\boost-1_45\boost\e xception\detail\error_info_impl.hpp 69 IMHO these classes should have a virtual destructor as they are intended to be used as base classes.
No they shouldn't. A virtual destructor is only needed when deleting through a base class pointer. This is explicitly forbidden by making the destructor protected.
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users