some problem regarding inheritance of and debugger
-
I found some runtime error in my solution with the IDE: Visual Studio .Net 2003. 1st problem: I inherited the STL class complex<_Ty>, and add some members to the class. However,I found the operator overloading didn't work well. I follow the way did in the overloading function:
return complex(x,y);
but the left side of the = lost many members. and the builder would inevitably warn:warning C4172: returning address of local variable or temporary 'Complex.h(382) : while compiling class-template member function 'Complex<_Ty>::_Myt &Complex<_Ty>::operator *(const Complex<_Ty>::_Myt &)' with [ _Ty=double ]
Is there any suggestion? thanks! 2nd problem: While debugging the code, I found SOME of the member functions cannot be broke! but others CAN! and some breakpoints would jump to the other functions while debugging. These break points would be marked with INFAMOUS white question marks which said:The breakpoint would not currently be hit. Invalid file line:353
I'd checked the configuration, it's set on debug mode. Searching on the web but found no proper way. Is there any suggestion? Thanks! -
I found some runtime error in my solution with the IDE: Visual Studio .Net 2003. 1st problem: I inherited the STL class complex<_Ty>, and add some members to the class. However,I found the operator overloading didn't work well. I follow the way did in the overloading function:
return complex(x,y);
but the left side of the = lost many members. and the builder would inevitably warn:warning C4172: returning address of local variable or temporary 'Complex.h(382) : while compiling class-template member function 'Complex<_Ty>::_Myt &Complex<_Ty>::operator *(const Complex<_Ty>::_Myt &)' with [ _Ty=double ]
Is there any suggestion? thanks! 2nd problem: While debugging the code, I found SOME of the member functions cannot be broke! but others CAN! and some breakpoints would jump to the other functions while debugging. These break points would be marked with INFAMOUS white question marks which said:The breakpoint would not currently be hit. Invalid file line:353
I'd checked the configuration, it's set on debug mode. Searching on the web but found no proper way. Is there any suggestion? Thanks!ytod wrote:
warning C4172: returning address of local variable or temporary
you might have declared the operator overloaded funtion to return either the address od reference. Remove the reference or pointer in the return type of the function. If you paste the function here I will try to make it correct.
ytod wrote:
While debugging the code, I found SOME of the member functions cannot be broke! but others CAN!
the breakpoint cannot be put in some place where.. 1. you have put a preprocessor switch so that, that part of code dosent get compiled and exists in the exe build 2. In an inline function 3. If control never reaches that point.
nave
-
I found some runtime error in my solution with the IDE: Visual Studio .Net 2003. 1st problem: I inherited the STL class complex<_Ty>, and add some members to the class. However,I found the operator overloading didn't work well. I follow the way did in the overloading function:
return complex(x,y);
but the left side of the = lost many members. and the builder would inevitably warn:warning C4172: returning address of local variable or temporary 'Complex.h(382) : while compiling class-template member function 'Complex<_Ty>::_Myt &Complex<_Ty>::operator *(const Complex<_Ty>::_Myt &)' with [ _Ty=double ]
Is there any suggestion? thanks! 2nd problem: While debugging the code, I found SOME of the member functions cannot be broke! but others CAN! and some breakpoints would jump to the other functions while debugging. These break points would be marked with INFAMOUS white question marks which said:The breakpoint would not currently be hit. Invalid file line:353
I'd checked the configuration, it's set on debug mode. Searching on the web but found no proper way. Is there any suggestion? Thanks!