0

I am trying to replace a proprietary histogram implementation with boost::histogram but I am stuck. Is it possible to inherit from boost::histogram and set axes at runtime?

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Elias
  • 452
  • 5
  • 11
  • 1
    Does the [second example using `make_histogram`](https://www.boost.org/doc/libs/1_77_0/libs/histogram/doc/html/histogram/guide.html#histogram.guide.making_histograms) answer your question? If not, can you supply a minimal example of what you're trying to achieve? – sehe Sep 01 '21 at 22:39
  • My need is to inherit and use boost::histogram as base class. I am using it internally with no problems but I can't figure out if I can use it as base class. The more I read about it I tend to believe I cannot. – Elias Sep 02 '21 at 19:29
  • In general you should not, unless types have been explicitly designed for inheritance (which is rare in C++ libraries, outside some very OOP libraries like Crypto++ that employ virtual functions for polymorphism, rather than virtual interfaces). Am I correct in thinking that the "and set axes at runtime" wasn't relevant to the question, actually? – sehe Sep 02 '21 at 23:07

0 Answers0