Boost logo

Boost Users :

From: Simon Buchan (simon_at_[hidden])
Date: 2005-10-05 23:48:47


BRIDGES Dick wrote:
<snip>
>
> Works fine now. I don't know why I find boost::bind so mysterious,
> but I *WILL* learn!
>
> Thank you for both the answers and your patience.
>
> Regards,
> Dick

You find it mysterious because it's not even slightly common outside of
functional languages. (I hope Boost can change this). Basicly: bind is
a function that creates a function (sortof) from a function and
arguments. Confused? Don't worry, that's normal. Essentially:

        bind(&X::f, &x, _1);

is the same as:

        f_result_type bound_f(f_arg1_type arg1)
        { return x.f(arg1);
        }

        // ...

        &bound_f

but with less hassles (ie. x can be local)


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net