forked from ShujiaHuang/Cpp-Primer-Plus-6th
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
adfecd9
commit f3e36f3
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
1. 不要在构造函数中再次调用构造函数 | ||
|
||
由于你再次调用的构造函数在原来的构造函数中是局部函数,所以再次调用的构造函数的所有的量可能都是局部变量,它在生命周期结束时,会面临被析构的危险,所以再次使用时就可能是垃圾值。 | ||
|
||
|
||
|
||
|
||
|