1

Possible Duplicate:
C++ macro/metaprogram to determine number of members at compile time

is there a way to detect at compile time how many members class has?
I've looked the web but no results.

Community
  • 1
  • 1
smallB
  • 16,662
  • 33
  • 107
  • 151

1 Answers1

0

There are API's for static analysis tools that could do this. Here at my work I use a product called understand 4 C++. It has a nifty C API, for which I wrote a managed C++/CLI wrapper API. That allows you to write tools using C# to target their API. Using this I have written tools that do things similar to what you want to do.

In your case, you could write a tool, get it to do what you want, and then call this tool as a post build event.

If you search this website for static analysis API's then you will find other useful hits.

C.J.
  • 15,637
  • 9
  • 61
  • 77