0
votes

I have a couple of structures that I need to automatically calculate the size of the struct for. Some of these structs are nested. I've tried using a consexpr auto size_of_struct = sizeof(struct) but this ended up only documenting size_of_struct = sizeof(struct). Is there a way to have the pre-processor of doxygen display the value in the generated documentation?

1
There is no way doxygen can know this as doxygen has no knowledge about how a compiler would layout the struct and also has no idea about the size of e.g. an int or a double. Note that, to the best of my knowledge, that the size of a struct is also compiler dependent and dependent on the optimizer flags.albert

1 Answers

2
votes

Upon request the comment as an answer:

There is no way doxygen can know this as doxygen has no knowledge about how a compiler would layout the struct and also has no idea about the size of e.g. an int or a double. Note that, to the best of my knowledge, that the size of a struct is also compiler dependent and dependent on the optimizer flags.