Why is destructor of `boost::multi_array_ref` non-virtual?

Viewed 338

The relationship among const_multi_array_ref, multi_array_ref and multi_array is as follows:

  • multi_array_ref is derived from const_multi_array_ref
  • multi_array is derived from multi_arry_ref

However, the destructors of const_multi_array_ref and multi_array_ref are non-virtual. In fact they do not have an explicitly implemented destructor. Only multi_array has a one. Does this imply the following usage is not recommended?

multi_array_ref<float, 2> * = new multi_array<float, 2>(extents[3][3]);

If so, why?

1 Answers
Related