Boost logo

Boost :

Subject: [boost] [variant] static_visitor has no virtual destructor.
From: Pierre Talbot (ptalbot_at_[hidden])
Date: 2012-11-07 13:30:40


Hello,

I have a compilation error with Boost (1.52) and g++ (4.7) with the flag
-Weffc++:

error: base class ‘class boost::static_visitor<std::basic_string<char>
>’ has a non-virtual destructor [-Werror=effc++]

And the static_visitor class is defined with a protected non-virtual
destructor:

template <typename R = ::boost::detail::static_visitor_default_return>
class static_visitor
     : public detail::is_static_visitor_tag
{
public: // typedefs

     typedef R result_type;

protected: // for use as base class only

     static_visitor() { }
     ~static_visitor() { }

};

Is it normal ? And if it is, how to avoid this error ?

Thank you for your help,

Pierre Talbot.


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