Advertisement
Guest User

Untitled

a guest
Feb 19th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. struct Base {
  2. std::string member;
  3. };
  4. int free_function(Base* b) {
  5. b->member = "Ohai!";
  6. }
  7. struct Derived : Base {
  8. Derived() {
  9. free_function(this); // UNDEFINED BEHAVIOUR
  10. }
  11. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement