Re: [Boost-users] Fwd: bind, template member function and thread
Olivier, I did my tests with boost 1.34.1 and VC Express 2005. Can you try at least with the version 1.34.1 of boost and your current compiler? Best Regards, Ovanes
On 11/14/07, Olivier Tournaire
wrote: Hi,
Does someone has an issue to this problem ? I am under VC7.1 with boost 1.33.1
2007/11/13, Olivier Tournaire < olitour@gmail.com>:
2007/11/13, Ovanes Markarian < om_boost@keywallet.com>:
And the function template ComputeRadiometries is the member of the Profile class? Can you please write the second error?
Yes. Please note that ComputeRadiometries is a member of the Profile class, and that I call it a member of the MPPGraph class. Here is the second error :
error C2780: 'boost::_bi::bind_t
,_bi::list_av_9 ::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7,B8) const,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : 10 arguments attendus - 4 fournis E:\librairies\boost_1.33.1_build\include\boost\bind\bind_mf_cc.hpp(222) : voir la déclaration de 'boost::bind'
However, where I write a simple function which encapsulates ComputeRadiometries, I got no error :
void lance_thread( boost::shared_ptr<Profile> p , boost::shared_ptr< TTImage <unsigned char> > image , eInterpolatorType typeinterp) { p->ComputeRadiometries(image,typeinterp); }
// In another member function :
boost::shared_ptr<Profile> p2 ( new Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); boost::shared_ptr<Profile> p3 ( new Profile(origine+(double)(-i)*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); lance_thread(p2,image_,BICUBIC); lance_thread(p3,image_,BICUBIC);
Regards
On 11/13/07, Olivier Tournaire
wrote: Here is the method signature :
// in profile.hpp template <class T> void ComputeRadiometries( boost::shared_ptr< TTImage <T> > image , const eInterpolatorType type_interpolator=BICUBIC ) { // ... }
Here is how I create the threads
// ... boost::shared_ptr<Profile> p2 ( new Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); boost::thread t( boost::bind ( &Profile::template ComputeRadiometries<unsigned char> , p2 , image_ , BICUBIC ) );
2007/11/13, Ovanes Markarian < om_boost@keywallet.com>:
Can you please post here som example how you function signature looks like, and how you create a new thread?
Regards, Ovanes
On 11/13/07, Olivier Tournaire
wrote: > 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
,_bi::list_av_1<A1>::type> > boost::bind(R T::* ,A1)' : 2 arguments attendus - 4 fournis > > (translation attempt : [...] 2 args waited, 4 given) > > _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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.
-- Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Same problem with 1.34.1. I really think that this errors come from my
compiler. I sould try with VC 2005, but it is very difficult for me and all
my projects ...
2007/11/14, Ovanes Markarian
Olivier, I did my tests with boost 1.34.1 and VC Express 2005. Can you try at least with the version 1.34.1 of boost and your current compiler?
Best Regards,
Ovanes
On 11/14/07, Olivier Tournaire
wrote: Hi,
Does someone has an issue to this problem ? I am under VC7.1 with boost 1.33.1
2007/11/13, Olivier Tournaire < olitour@gmail.com>:
2007/11/13, Ovanes Markarian < om_boost@keywallet.com>:
And the function template ComputeRadiometries is the member of the Profile class? Can you please write the second error?
Yes. Please note that ComputeRadiometries is a member of the Profile class, and that I call it a member of the MPPGraph class. Here is the second error :
error C2780: 'boost::_bi::bind_t
,_bi::list_av_9 ::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7,B8) const,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : 10 arguments attendus - 4 fournis E:\librairies\boost_1.33.1_build\include\boost\bind\bind_mf_cc.hpp(222) : voir la déclaration de 'boost::bind'
However, where I write a simple function which encapsulates ComputeRadiometries, I got no error :
void lance_thread( boost::shared_ptr<Profile> p , boost::shared_ptr< TTImage <unsigned char> > image , eInterpolatorType typeinterp) { p->ComputeRadiometries(image,typeinterp); }
// In another member function :
boost::shared_ptr<Profile> p2 ( new Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); boost::shared_ptr<Profile> p3 ( new Profile(origine+(double)(-i)*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); lance_thread(p2,image_,BICUBIC); lance_thread(p3,image_,BICUBIC);
Regards
On 11/13/07, Olivier Tournaire
wrote: Here is the method signature :
// in profile.hpp template <class T> void ComputeRadiometries( boost::shared_ptr< TTImage <T> > image , const eInterpolatorType type_interpolator=BICUBIC ) { // ... }
Here is how I create the threads
// ... boost::shared_ptr<Profile> p2 ( new Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); boost::thread t( boost::bind ( &Profile::template ComputeRadiometries<unsigned char> , p2 , image_ , BICUBIC ) );
2007/11/13, Ovanes Markarian < om_boost@keywallet.com>: > > Can you please post here som example how you function > signature looks like, and how you create a new thread? > > Regards, > Ovanes > > On 11/13/07, Olivier Tournaire
wrote: > > > 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 ,_bi::list_av_1<A1>::type> > > boost::bind(R T::* ,A1)' : 2 arguments attendus - 4 fournis > > > > (translation attempt : [...] 2 args waited, 4 given) > > > > _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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.
-- Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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.
I would suggest to try it with a small piece of code in an independent
project. This project can easily be migrated to VC2005.
On 11/14/07, Olivier Tournaire
Same problem with 1.34.1. I really think that this errors come from my compiler. I sould try with VC 2005, but it is very difficult for me and all my projects ...
2007/11/14, Ovanes Markarian < om_boost@keywallet.com>:
Olivier, I did my tests with boost 1.34.1 and VC Express 2005. Can you try at least with the version 1.34.1 of boost and your current compiler?
Best Regards,
Ovanes
On 11/14/07, Olivier Tournaire
wrote: Hi,
Does someone has an issue to this problem ? I am under VC7.1 with boost 1.33.1
2007/11/13, Olivier Tournaire < olitour@gmail.com>:
2007/11/13, Ovanes Markarian < om_boost@keywallet.com>:
And the function template ComputeRadiometries is the member of the Profile class? Can you please write the second error?
Yes. Please note that ComputeRadiometries is a member of the Profile class, and that I call it a member of the MPPGraph class. Here is the second error :
error C2780: 'boost::_bi::bind_t
,_bi::list_av_9 ::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7,B8) const,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : 10 arguments attendus - 4 fournis E:\librairies\boost_1.33.1_build\include\boost\bind\bind_mf_cc.hpp(222) : voir la déclaration de 'boost::bind'
However, where I write a simple function which encapsulates ComputeRadiometries, I got no error :
void lance_thread( boost::shared_ptr<Profile> p , boost::shared_ptr< TTImage <unsigned char> > image , eInterpolatorType typeinterp) { p->ComputeRadiometries(image,typeinterp); }
// In another member function :
boost::shared_ptr<Profile> p2 ( new Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); boost::shared_ptr<Profile> p3 ( new Profile(origine+(double)(-i)*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); lance_thread(p2,image_,BICUBIC); lance_thread(p3,image_,BICUBIC);
Regards
On 11/13/07, Olivier Tournaire
wrote: > > Here is the method signature : > > // in profile.hpp > template <class T> void ComputeRadiometries( > boost::shared_ptr< TTImage <T> > image , const eInterpolatorType > type_interpolator=BICUBIC ) > { > // ... > } > > Here is how I create the threads > > // ... > boost::shared_ptr<Profile> p2 ( new > Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ > ) ); > boost::thread t( > boost::bind > ( > &Profile::template > ComputeRadiometries<unsigned char> > , p2 > , image_ > , BICUBIC > ) > ); > > 2007/11/13, Ovanes Markarian < om_boost@keywallet.com>: > > > > Can you please post here som example how you function > > signature looks like, and how you create a new thread? > > > > Regards, > > Ovanes > > > > On 11/13/07, Olivier Tournaire
wrote: > > > > > 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 ,_bi::list_av_1<A1>::type> > > > boost::bind(R T::* ,A1)' : 2 arguments attendus - 4 fournis > > > > > > (translation attempt : [...] 2 args waited, 4 given) > > > > > > _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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.
-- Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I used this piece of code :
#include
I would suggest to try it with a small piece of code in an independent project. This project can easily be migrated to VC2005.
On 11/14/07, Olivier Tournaire
wrote: Same problem with 1.34.1. I really think that this errors come from my compiler. I sould try with VC 2005, but it is very difficult for me and all my projects ...
2007/11/14, Ovanes Markarian < om_boost@keywallet.com>:
Olivier, I did my tests with boost 1.34.1 and VC Express 2005. Can you try at least with the version 1.34.1 of boost and your current compiler?
Best Regards,
Ovanes
On 11/14/07, Olivier Tournaire
wrote: Hi,
Does someone has an issue to this problem ? I am under VC7.1 with boost 1.33.1
2007/11/13, Olivier Tournaire < olitour@gmail.com>:
2007/11/13, Ovanes Markarian < om_boost@keywallet.com>: > > And the function template ComputeRadiometries is the member of > the Profile class? Can you please write the second error?
Yes. Please note that ComputeRadiometries is a member of the Profile class, and that I call it a member of the MPPGraph class. Here is the second error :
error C2780: 'boost::_bi::bind_t
,_bi::list_av_9 ::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7,B8) const,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : 10 arguments attendus - 4 fournis E:\librairies\boost_1.33.1_build\include\boost\bind\bind_mf_cc.hpp(222) : voir la déclaration de 'boost::bind'
However, where I write a simple function which encapsulates ComputeRadiometries, I got no error :
void lance_thread( boost::shared_ptr<Profile> p , boost::shared_ptr< TTImage <unsigned char> > image , eInterpolatorType typeinterp) { p->ComputeRadiometries(image,typeinterp); }
// In another member function :
boost::shared_ptr<Profile> p2 ( new Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); boost::shared_ptr<Profile> p3 ( new Profile(origine+(double)(-i)*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ ) ); lance_thread(p2,image_,BICUBIC); lance_thread(p3,image_,BICUBIC);
Regards
On 11/13/07, Olivier Tournaire
wrote: > > > > Here is the method signature : > > > > // in profile.hpp > > template <class T> void ComputeRadiometries( > > boost::shared_ptr< TTImage <T> > image , const eInterpolatorType > > type_interpolator=BICUBIC ) > > { > > // ... > > } > > > > Here is how I create the threads > > > > // ... > > boost::shared_ptr<Profile> p2 ( new > > Profile(origine+(double)i*width_sur_nb_fois_wdir,rect->GetHeightDirection(),MPPParameters_.ProfilesNbPoints_,MPPParameters_.ProfilesDistancePoints_ > > ) ); > > boost::thread t( > > boost::bind > > ( > > &Profile::template > > ComputeRadiometries<unsigned char> > > , p2 > > , image_ > > , BICUBIC > > ) > > ); > > > > 2007/11/13, Ovanes Markarian < om_boost@keywallet.com>: > > > > > > Can you please post here som example how you function > > > signature looks like, and how you create a new thread? > > > > > > Regards, > > > Ovanes > > > > > > On 11/13/07, Olivier Tournaire wrote: > > > > > > > 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 ,_bi::list_av_1<A1>::type> > > > > boost::bind(R T::* ,A1)' : 2 arguments attendus - 4 fournis > > > > > > > > (translation attempt : [...] 2 args waited, 4 given) > > > > > > > > > > _______________________________________________ > Boost-users mailing list > Boost-users@lists.boost.org > 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.
-- Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org 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.
participants (2)
-
Olivier Tournaire
-
Ovanes Markarian