Skip to content

Instantly share code, notes, and snippets.

@melvyniandrag
Created January 21, 2017 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melvyniandrag/f593eda072e7994c47fb4b1252773ed4 to your computer and use it in GitHub Desktop.
Save melvyniandrag/f593eda072e7994c47fb4b1252773ed4 to your computer and use it in GitHub Desktop.
The destructor is called as described in the concrrency tutorial.
#include <iostream>
#include <string>
class BartoszMilewski{
public:
BartoszMilewski(){
greeting = "Hello";
std::cout << greeting << std::endl;
}
~BartoszMilewski(){
std::cout << greeting << std::endl;
}
std::string greeting;
};
void takeRValue(BartoszMilewski && bm){
bm.greeting = "Goodbye";
}
int main(){
takeRValue(BartoszMilewski());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment