Skip to content

Instantly share code, notes, and snippets.

@AntonKueltz
Last active November 29, 2018 20:49
Show Gist options
  • Save AntonKueltz/91bbdb7e124ef3d8da4a8659f7c4c792 to your computer and use it in GitHub Desktop.
Save AntonKueltz/91bbdb7e124ef3d8da4a8659f7c4c792 to your computer and use it in GitHub Desktop.
// house.h
class House {
//copying a house doesn't make much sense so disallow use of copy functions
private:
House(const House&); // copy constructor
House& operator=(const House&); // copy assignment
};
// main.cpp
int main(int argc, char * argv[]) {
House h1;
House h2(h1); // compiler error!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment