 <p>You touched an old problem with C++, which is very limited <em>reflection</em> functionality in the language. The discussion below is worth to look at in case you came from a language <em>with</em> reflection:</p> <p><a href="http://stackoverflow.com/questions/41453/how-can-i-add-reflection-to-a-c-application">How can I add reflection to a C++ application?</a> </p> <p>As for a practical advice, all other answers given here make perfect sense.</p>