0

The boost::describe library works when defining reflection info for member functions and variables, but is it possible to describe constructors?

JvJ
  • 112
  • 3
  • To be useful, the description would have to be able to point to said constructor. At which point you run into https://stackoverflow.com/questions/954548/how-to-pass-a-function-pointer-that-points-to-constructor -- use a static factory method instead? – teapot418 May 09 '23 at 20:53
  • I'd love to use a static factory method, but I'm using boost describe for types that are defined elsewhere. And I'm not necessarily interested in pointing to a constructor. If I know the type signature of the parameters, I can call construct_from_tuple. – JvJ May 09 '23 at 21:35
  • So, you want to add a fictitious method name (e.g. `__construct`) pointing nowhere with the right signature to the description? Probably possible if you look under the hood at what happens for other methods. – teapot418 May 10 '23 at 08:32

0 Answers0