Skip to content

Instantly share code, notes, and snippets.

@jesseschalken
Last active September 22, 2022 09:44
Show Gist options
  • Save jesseschalken/b81ea3128cbf87a43e1df5f0fb137564 to your computer and use it in GitHub Desktop.
Save jesseschalken/b81ea3128cbf87a43e1df5f0fb137564 to your computer and use it in GitHub Desktop.
C++ Special Member Functions
  • βšͺ = uninitialized memory
  • πŸ”΅ = value 1
  • 🟒 = value 2
name operator note
βšͺ β†’ πŸ”΅ construction A() constructor may require parameters
constructor may have multiple overloads
πŸ”΅ β†’ βšͺ destruction ~A()
πŸ”΅ βšͺ β†’ πŸ”΅ πŸ”΅ copy construction A(const A& a)
πŸ”΅ 🟒 β†’ πŸ”΅ πŸ”΅ copy assignment A& operator=(const A& a)
πŸ”΅ βšͺ β†’ βšͺ πŸ”΅ move construction A(A&& a) destructor on old value will also be called
πŸ”΅ 🟒 β†’ βšͺ πŸ”΅ move assignment A& operator=(A&& a) destructor on old value will also be called
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment