c++ 析构函数=default
时间: 2023-10-11 08:08:55 浏览: 203
在C++11标准中,当我们在类中将析构函数声明为"default"时,它表示我们要使用默认的析构函数。这意味着编译器将自动生成一个默认的析构函数,执行所需的清理操作,如释放内存等。这对于没有特殊需求的类来说是非常方便的,因为我们不需要自己编写析构函数的实现。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [构造函数vs析构函数添加default关键字](https://blog.csdn.net/qq_37026934/article/details/124362476)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [C++学习笔记19:构造函数与析构函数](https://blog.csdn.net/effort_study/article/details/99653883)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文