Skip to content

Instantly share code, notes, and snippets.

@garbear
Created June 11, 2013 21:10
Show Gist options
  • Save garbear/5760733 to your computer and use it in GitHub Desktop.
Save garbear/5760733 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
class String
{
public:
String() { }
~String()
{
cout << "~String()" << endl;
}
int foo()
{
cout << "foo()" << endl;
return 0;
}
};
void bar(int i)
{
cout << "bar()" << endl;
int breakpoint = 0;
breakpoint++;
}
int main()
{
cout << "main()" << endl;
bar(String().foo());
int i; cin >> i;
return 0;
}
// Program output:
// main()
// foo()
// bar()
// ~String()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment