Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-05-09 12:08:52


From: Jason Hise <chaos_at_[hidden]>
> David Abrahams wrote:
> >"Andrei Alexandrescu (See Website For Email)" <SeeWebsiteForEmail_at_[hidden]> writes:
> >>Pavel Vozenilek wrote:
> >>>"Jason Hise" wrote:
> >>>
> >>>>In many cases I am getting the warning that specific classes have
> >>>>virtual functions, but non virtual destructors. This is
> >>>>intentional, because they only have virtual functions in debug mode
> >>>>(pure virtual, to make the singleton uncreatable by client code)
> >>>>and will never be destroyed through a pointer to base. I wanted to
> >>>>avoid the overhead of a vtable in release mode. Is there a way to
> >>>>disable this specific warning while compiling with gcc?
> >>>>
> >>>No, there's no way to disable this or that warning using pragma
> >>>in GCC (though I read somewhere they will finally add such feature).
> >>>Perhaps you may use a kludge with conditional macros.
> >>>
> >>Wouldn't making the destructor virtual in debug mode serve as a
> >>satisfactory solution?
> >>
> I suppose this would work. The only problem is that client code must
> remember to do this as well if they choose for their singleton to
> provide a destructor.

Nope. The derived class dtor would be virtual
automatically. (12.4/7)

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk