Jump to content

C++: Difference between revisions

57 bytes added ,  3 February 2020
Line 450: Line 450:
* Assignment operator
* Assignment operator
* Destructor releasing resources
* Destructor releasing resources
* Swap function
* Swap function (for <code>std::swap</code>)
* Move constructor (since C++11)
* Move constructor (since C++11, for <code>std::move</code>)
{{hidden | Example RAII Class |
{{hidden | Example RAII Class |
Stolen from [https://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom stack overflow]
Stolen from [https://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom stack overflow]