Boost logo

Boost :

From: larsbj_at_[hidden]
Date: 2001-06-12 13:23:22

Douglas Gregor <gregod_at_[hidden]> writes:

| Deferring calls and binding arguments are orthogonal (though complementary)
| activities and they should be separate libraries. Boost.Function is intended
| to handle deferred calls and nothing more. There are other libraries that
| bind arguments - the Lambda library ( is one such
| library, and I though someone was working on a more lightweight binding
| library for Boost...
| You example above, with Boost.Function and a binders library, would be:
| function<void> dh = foo;
| dh();
| dh = bind(foo, 42);
| dh();

Ok, I see.

What I want to do is:

void foo() { std::cout << "Hello!" << std::endl; }
void foo1(int i) { std::cout << i << std::endl; }

struct Blob {
        void foo() {
                std::cout << "Goodbye!" << std::endl;

int main() {
        Blob blob;
        thread_handle handle = create_thread(bind(&foo));
        thread_handle handle2 = create_thread(bind(&blob, &Blob::foo));
        thread_handle handle3 = create_thread(bind(&foo1, 42));

And I see now that I only need a binder lib for this, not

Is there a binders lib proposed for boost that would allow me to do
the above?


Boost list run by bdawes at, gregod at, cpdaniel at, john at