Boost logo

Boost Users :

From: Olivier Tournaire (olitour_at_[hidden])
Date: 2007-11-13 09:23:13


Geat, seems simpler. However, it does not compile for me (boost 1.33.1). Aot
of error, but the first one seems to be the more interesting :

error C2780:
'boost::_bi::bind_t<R,boost::_mfi::dm<R,T>,_bi::list_av_1<A1>::type>
boost::bind(R T::* ,A1)' : 2 arguments attendus - 4 fournis

(translation attempt : [...] 2 args waited, 4 given)

2007/11/13, Ovanes Markarian <om_boost_at_[hidden]>:
>
> Why do you need a function instance at all?
>
> Just use boost::bind and that's it...
>
> Profile p;
> boost::shared_ptr< TTImage<unsigned char> > image(new TTImage<unsigned
> char>);
>
> boost::thread t(
> boost::bind
> (
> &Profile::template ComputeRadiometries<unsigned char>
> , p
> , image
> , BICUBIC
> )
> );
>
> This code compiles fine for me.
>
> Regards,
> Ovanes
>
> On 11/13/07, Olivier Tournaire < olitour_at_[hidden]> wrote:
> >
> >
> >
> > 2007/11/13, Ovanes Markarian <om_boost_at_[hidden]>:
> > >
> > >
> > >
> > > On 11/13/07, Olivier Tournaire < olitour_at_[hidden]> wrote:
> > > >
> > > > Yep, that what I tried, but it does not work. The compiler error is
> > > > described below.
> > >
> > >
> > > This is really strange. This code compiles fine:
> > > typedef bool (Profile::*mem_fcn)(boost::shared_ptr< TTImage
> > > <unsigned char> >, eInterpolatorType);
> > >
> > > mem_fcn f = &Profile::template ComputeRadiometries<unsigned char>;
> > >
> > > and the doc example states for member functions:
> > > boost::function<int (X*, int)> f;
> > >
> > > f = &X::foo;
> > >
> > > X x;
> > > f(&x, 5);
> > >
> > > But I also got errors.
> > >
> >
> > Yes. The first code I posted came from the doc. The one you just gave
> > me compiles fine.
> > However, how can I use it to create a thread and pass parameters ?
> >
> > Regards
> >
> > Regards,
> > > Ovanes
> > >
> >
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

-- 
Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux.
Courage.


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