|
I once wanted to ask this question too. At that time, I was reading a book by Qian Neng, but I didn’t write about this reason. Later, I read a book by a foreigner.
If you pass a value without passing a reference, the compiler will report a memory overflow,
The reason is: If the parameter is passed by value, you need to create a copy of the value. How to create a copy?? Use the copy constructor, but the original function itself is a copy constructor, so it calls itself, so, Form a recursive call, causing all memory to be exhausted
If it is a quote, then you can not make a copy...
It seems that I am a little bit faster than the host...I learned later, hehe!! Come on together!! |
|