Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2006-10-21 15:17:51


On 10/21/2006 11:11 AM, Larry Evans wrote:
[snip]
> Sorry for noise. I still need to reread the docs and
> experiment before I understand how bind works.

The following works:

   template
   < unsigned I
>
struct a
{};

struct f4
{
     template< typename T1, typename T2, typename T3, typename T4 >
     struct apply
     {
         typedef vector<T1,T2,T3,T4> type;
     };
};

MPL_TEST_CASE() // partially bound metafunction classes
{
     typedef bind4<f4, a<1>,a<2>,_1,_2 > f4_a1_a2;
     typedef apply_wrap2<f4_a1_a2, a<3>,a<4> >::type f4_a1_a2_a3_a4;
     MPL_ASSERT((
boost::is_same<f4_a1_a2_a3_a4,vector<a<1>,a<2>,a<3>,a<4> > > ));
}

So, apparently, the n in apply_wrapn is >= max placeholder arg
in the bind args. Rereading boost.bind, I now see the
similarity. Sorry for the noise, but further examples
like the f4 example above would have helped.


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