If i comment the Num 17 line,the return value is correct,or else it return the register address,so I want to get the value from the register address,but I don't know how to do it.Any ideas to get the value would be appreciated.
Your conclude seems well,an reference must be related to a real allocated area.But if I comment line 11 ,the line 18 return the correct result.This hints the operator overload function must done something cause this error,I think the return value of int& operator()() is the real reason,so I test it as follows:
and I can trust that the error result 34513960 is a register address(using gdb detection),the test shows this error is not due to int& operator()(),That is when I notice that I was wrong.The real reason is as you said the constructor parameter is temporary,This is an important lesson to me.The constructor parameter had been free after I called a member function I thought.Thank you Bazzy.