Catch missing virtual destructors, enable g++ warnings

This commit is contained in:
Jason Turner
2014-03-04 11:20:45 -07:00
parent daf5480c48
commit ebbcc5cbdb
3 changed files with 9 additions and 6 deletions

View File

@@ -42,6 +42,7 @@ namespace chaiscript {
private:
struct Data
{
virtual ~Data() {}
virtual void *data() = 0;
virtual const std::type_info &type() const = 0;
virtual std::shared_ptr<Data> clone() const = 0;
@@ -56,6 +57,8 @@ namespace chaiscript {
{
}
virtual ~Data_Impl() {}
virtual void *data()
{
return &m_data;
@@ -94,9 +97,9 @@ namespace chaiscript {
}
template<typename ValueType>
Any(const ValueType &t_value)
Any(const ValueType &t_value)
: m_data(std::shared_ptr<Data>(new Data_Impl<ValueType>(t_value)))
{
m_data = std::shared_ptr<Data>(new Data_Impl<ValueType>(t_value));
}
Any & operator=(const Any &t_any)