Last active
November 29, 2018 20:49
-
-
Save AntonKueltz/fe5b1cea9e13c34994dc4b8429f87f1e to your computer and use it in GitHub Desktop.
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
// empty.h | |
class Empty { | |
// this class declares no members but still will implicitly have the | |
// below declared by the compiler (in the public scope) | |
/* | |
Empty(){...} // default constructor | |
Empty(const Empty& rhs){...} // copy constructor | |
~Empty(){...} // default destructor | |
Empty& operator=(const Empty& rhs){...} // copy assignment operator | |
*/ | |
}; | |
// main.cpp | |
int main(int argc, char * argv[]) { | |
// code below is legal and will compile as constructors and methods | |
// used are implicitly declared by compiler | |
Empty e1; | |
Empty e2(e1); | |
e1 = e2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment