Listing all variables in a namespace

Apr 2, 2010 at 5:44pm
Hi,

I've googled, but can't find the answer. How do I list / find out all the variables used in a namespace? Specifically, I'd like to know the variables in the std namespace, since I use that one in my programs.

I'd like to use cout to display all the variable names in std, but I'm not sure how to get started retrieving the variable names.

Thanks
Apr 2, 2010 at 5:49pm
C++ doesn't mix in-code names and variable names too well. Your only option afaik is to sift through the namespace by hand and compose a list of the items therein.
Apr 3, 2010 at 5:25pm
I'd probably use Doxygen to avoid doing it all by hand.
Apr 9, 2010 at 8:57pm
Thanks for the help. I found a few solutions.

Like choisum says, Doxygen helps. Here's the Doxygen ref for std in libstdc++
http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01127.html

Also if you're using gdb to debug, just type "info variables"
Topic archived. No new replies allowed.