Fix C++ example

This commit is contained in:
Zeex 2013-01-15 05:14:54 +07:00
parent a2d0166a55
commit 4599d630a8

View File

@ -58,12 +58,12 @@ int main() {
SubHook foo_hook;
void my_foo(int x) {
SubHook::ScopedRemove(&foo_hook);
// ScopedRemove removes the specified hook and automatically re-installs it
// when it goes out of scope (thanks to C++ destructors).
SubHook::ScopedRemove remove(&foo_hook);
std::cout << "foo(" << x < ") called" << std::endl;
foo(x);
/* The hook wll be re-installed automatically upon return. */
}
int main() {