This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: calling cast operator


On Monday 02 May 2011 17:50:27 ext Klaus Rudolph wrote:
> Hi all,
> 
> can I use a cast operator from an object on gdb?
> 
> class B
> {
> ...
> };
> 
> class A
> {
>    operator B()
> };
> 
> anyFunc()
> {
>    A a;
> 
> -> breakpoint
> }
> 
> how can I get the value of the operation "a.operator B();" on the command line?
> 
> print a.operator B() 

"print a.'operator B'()" might work, and possibly  "print (B)a", too.

Andre'


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]