summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/utils/test_bind.cc
diff options
context:
space:
mode:
authorschodet2005-03-13 20:26:23 +0000
committerschodet2005-03-13 20:26:23 +0000
commitfcfd616f76345787a8eb1318e482ab1076d50039 (patch)
treeadb7200c223de2cd3839bf9c922894f48f377dae /2005/i/robert/src/utils/test_bind.cc
parenta5ccb9a2944290075e032a8a18102a046841e808 (diff)
Ajout de commentaires.
Ajout de l'ObjectBinder.
Diffstat (limited to '2005/i/robert/src/utils/test_bind.cc')
-rw-r--r--2005/i/robert/src/utils/test_bind.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/2005/i/robert/src/utils/test_bind.cc b/2005/i/robert/src/utils/test_bind.cc
index 9ebdc4e..b883cbe 100644
--- a/2005/i/robert/src/utils/test_bind.cc
+++ b/2005/i/robert/src/utils/test_bind.cc
@@ -37,9 +37,21 @@ g (const char *s)
std::cout << "g " << s << std::endl;
}
+class H
+{
+ public:
+ void f (void)
+ {
+ std::cout << "h" << std::endl;
+ }
+};
+
int
main (void)
{
- utils::bind<void> (&f, 42) ();
- utils::bind<void> (&g, "hello world !") ();
+ // Create the callback and execute it.
+ bind<void> (&f, 42) ();
+ bind<void> (&g, "hello world !") ();
+ H h;
+ bind<void, H> (&H::f, &h) ();
}