Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-08-03 23:48:18


"Pavel Chikulaev" <pavel.chikulaev_at_[hidden]> writes:

> Hi David,
>
> Please take a closer look at:
>
> http://boost-consulting.com/boost/libs/parameter/doc/html/index.html#id15
>
> [quote]
> template <class T>
> struct construct2
> {
> typedef T result_type;
>
> template <class A1, class A2>
> T operator() { return T(a1,a2); }
> };
>
> and use Boost.Bind_ to generate the function object::
>
> boost::bind(construct2<default_color_map>,num_vertices(g),i)
> [/quote]
>
> That won't compile, and library called Boost.Bind (not Bind_) :).

Good catch.

> That should be:
>
> template <class T>
> struct construct2
> {
> typedef T result_type;
>
> template <class A1, class A2>
> T operator(A1 & a1, A2 & a2) { return T(a1,a2); }
> };

I'm afraid that won't compile either.

> and use Boost.Bind to generate the function object::
>
> boost::bind(construct2<default_color_map>(),num_vertices(g),i)
>
> isn't it?

Something like that. Thanks, I'll make the fix.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk