Boost logo

Boost Users :

Subject: Re: [Boost-users] [lambda] Can't quite get the hang of it!
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-12-05 16:32:18


AMDG

Robert Jones wrote:
> but I'd like the nested clip function to be fn( i, j ), so I tried this...
>
> boost :: function< void( int, int ) > clip2 =
> boost :: lambda :: bind( clip, img -> m7[ _2 ][ _1 ], mpr[ _2 ][ _1 ] );
>
> for( j = joff; j != jlast; ++ j )
> for( i = ioff; i != ilast; ++ i )
> clip2( i, j );
>
> Which doesn't work. I think I need some boost::refs around the arrays
> I'm subscripting,
> but I can't quite seem to get it right.

Boost.Lambda uses var.

var(img->m7)[_2][_1];

In Christ,
Steven Watanabe


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