Re: Is is possible to use the name of a variable in the constructor?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Gunther Piez <gpiez@xxxxxx> writes:

> Am Montag, 1. August 2005 02:04 schrieb Ian Lance Taylor:
> > Gunther Piez <gpiez@xxxxxx> writes:
> > > struct uniform {
> > > 	uniform() {
> > > 		cout << "A variable called " << __PRETTY_VARNAME__ << " was just
> > > instantinated (sp)" << endl;
> > > 	}
> > > };

...

> Maybe it is possible to use the debugging information somehow? At least the 
> debugger usually knows the names of variables.

Maybe it is possible, but nothing straightforward comes to mind.
Remember that the debugger doesn't know the name within
uniform::uniform.  It only knows the name if you go up the stack frame
to the caller.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux