Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1288 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  Un usage de boost::function dans un appel à boost::thread

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Un usage de boost::function dans un appel à boost::thread

n°1738229
NounouRs
Non parce que c pas mon pied !
Posté le 28-05-2008 à 11:26:02  profilanswer
 

Bonjour,
 
Voici ce que je cherche à faire : créer un thread BOOST à partir d'une fonction (globale) qui prend des paramètres
J'ai penser à utiliser boost::function, mais sans reussir, et bien, sur l'appel d'une reference sur fonction qui prend des parametres ne marche pas en entrée du constructeur de boost::thread...
 

Code :
  1. // en dehors de toute classe, fonctions globales
  2. void launchWxThread(SystemLaunch parameters) {
  3. /* Mon code */
  4. }
  5. void launchWxTestApp(SystemLaunch parameters)
  6. {
  7. //AVANT : ca marche mais c'est crade et j'ai du modifier la signature, c'est nul
  8. g_launchParameters = parameters;
  9. boost::thread threadGui(&launchWxThread);
  10. //APRES : ca marche pas  --  error C2102: '&' requires l-value
  11. boost::thread threadGui(&launchWxThread(parameters));
  12. //Idée :
  13. boost::function<void (SystemLaunch)>  foo ;
  14. foo = &launchWxThread;
  15. if (foo)
  16.  boost::thread threadGui(foo(parameters));
  17. // J'y comprend rien à boost::function , qqun pourrait m'expliquer et m'aider ?
  18. }


Message édité par NounouRs le 28-05-2008 à 11:32:58
mood
Publicité
Posté le 28-05-2008 à 11:26:02  profilanswer
 

n°1738233
Joel F
Real men use unique_ptr
Posté le 28-05-2008 à 11:33:39  profilanswer
 

boost::thread comme indiqué dans la doc attend une fonction dont le prototype est void (*)(void). Dans ton cas, il faut creer une mini-classe qui encapsule l'appel à ta fonction et qui prend en parametres du constructeurs les aprametres de ta fonction. la ton machin peut pas macher car boost::function(f) a trjrs la même signature que f et ici c'ets pas void()(void).

n°1738236
NounouRs
Non parce que c pas mon pied !
Posté le 28-05-2008 à 11:36:52  profilanswer
 

En effet, je suis aller voir la signature du constructeur et thread attend void fct(void)    c'est bizarre comme choix de la part de boost...
Je vais donc faire une encapsulation

n°1738238
Joel F
Real men use unique_ptr
Posté le 28-05-2008 à 11:38:46  profilanswer
 

non, c'est le seul moyen d'avoir quelque chose de cohérent et qui prends pas 1598408445 lignes de codes. Le fait de forcer à encapsuler le thread et son état dans une classe et à déléguer l'avancement des choses à cette dernière est un bon schéma.
 
Et pour t'éviter un nouveau poste au sujet des perfs, fait gaffe que les objets thread sont copiés dans le thread group. Donc fait bien gaffe à ce qui se passe dans ton constructeur et ton constructeur de copie.

n°1738240
NounouRs
Non parce que c pas mon pied !
Posté le 28-05-2008 à 11:46:16  profilanswer
 

J'ai du mal comprendre, j'ai mis en dessous la transcription de ton idée...
Si j'encapsule l'appelle de ma fonction, ca donne ca ?
 
Mais comment tu vois l'appelle à call ?
   boost::thread threadGui(&miniClass(parameters)->call);   ????  
 

Code :
  1. class miniClass {
  2. public :
  3. miniClass(SystemLaunch parameters);
  4. void call();
  5. private :
  6. SystemLaunch m_parameters;
  7. };
  8. miniClass::miniClass(SystemLaunch parameters)
  9. {
  10. m_parameters = parameters;
  11. }
  12. void miniClass::call()
  13. {
  14. launchWxThread(m_parameters);
  15. }

n°1738243
Joel F
Real men use unique_ptr
Posté le 28-05-2008 à 11:50:31  profilanswer
 

Presque pas en fait :o
 

Code :
  1. class ma_classe_thread
  2. {
  3.   public :
  4.   ma_classe_thread(const SystemLaunch& p) : m_parameters(p)
  5.   void operator()()
  6.   {
  7.      launchWxThread(m_parameters);
  8.   }
  9.   private :
  10.   SystemLaunch m_parameters;
  11. };
  12. int mian()
  13. {
  14.   boost::thread threadGui( ma_classe_thread(parameters) );
  15. }


 
A voir selon comment ton lauchWXThread marche si t'as pas besoin d'un while( ??? ) dans ton operator()()

n°1738248
NounouRs
Non parce que c pas mon pied !
Posté le 28-05-2008 à 12:02:19  profilanswer
 

merci, je pense que ca va m'aider, j'ai encore à dénouer 2 3 trucs

n°1738367
Amonchakai
Posté le 28-05-2008 à 15:24:45  profilanswer
 

Bonjour,
 
    Dans ce cas là on aurai pas pus utiliser un boost::bind ? et faire :
 

Code :
  1. boost::thread threadGui(boost::bind(launchWxThread, m_parameters));


 
ça aurait permis de se passer de la classe subsidiaire non ?

n°1738401
NounouRs
Non parce que c pas mon pied !
Posté le 28-05-2008 à 16:10:05  profilanswer
 

Alors, oui, ca marche parfaitement, mais je ne comprend pas du tout pourquoi...
 
Je fais encore tres mal la distinction entre boost::function (pointeur sur des fonction)   et boost::bind  (pointeur sur je ne sais quoi)

n°1738412
Amonchakai
Posté le 28-05-2008 à 16:36:25  profilanswer
 

Ben en fait le boost:function c'est une classe qui encapsule les pointeurs de fonctions. Donc ça s'utilise comme une fonction.
Le boost::bind ça permet de spécialiser une fonction.
 
dans ton exemple :

Code :
  1. void launchWxThread(SystemLaunch parameters) {
  2. /* Mon code */
  3. }
  4. // ici tu as une fonction, qui prend en paramètre un SystemLaunch et qui ne retourne rien.
  5. boost::function<void (SystemLaunch) > fonction(launchWxThread);
  6. // donc a partir de là, utiliser fonction ou launchWxThread fait exactement la même chose...
  7. // après si tu veux spécialiser ta fonction comme ça :
  8. boost::function<void () > fonction_spe = boost::bind(fonction, parameter);
  9. // ici, comme tu le vois à la signature de fonction_spe c'est devenu une fonction qui ne prend aucun argument et qui ne retourne rien.
  10. // l'idée de boost::bind c'est de créer une fonction à partir d'une autre fonction en forçant la valeur de vertains paramètres.


 
 
Voilà, après je te recommande d'aller voir la doc de boost. Je trouvais qu'elle était plutôt bien faite :)


Message édité par Amonchakai le 28-05-2008 à 16:38:05
mood
Publicité
Posté le 28-05-2008 à 16:36:25  profilanswer
 

n°1738432
NounouRs
Non parce que c pas mon pied !
Posté le 28-05-2008 à 17:12:27  profilanswer
 

Bin faite, c'est là où on n'est pas d'accord, certaines section sont très bien, d'autre n'apportent absolument aucune info...  pour les boost::function, je la trouve tres mal faite... ils compliquent l'exemple de départ sans parler d'appel inter class, c'est n'importe quoi... a croire que boost est une librairie C et pas C++... tous leurs exemples sont avec des struct, ils décollent jamais de ca... faut lire entre les lignes, OK, mais quand on est fatigué, c'est dur !!! [:nounours]


Message édité par NounouRs le 28-05-2008 à 17:12:48
n°1738434
Joel F
Real men use unique_ptr
Posté le 28-05-2008 à 17:14:51  profilanswer
 

pour certains trucs, tu apprends plus avec les exemples du tarball qu'avec la doc.

n°1738465
Amonchakai
Posté le 28-05-2008 à 19:08:32  profilanswer
 

Oui, c'est vrai que je viens de voir qu'ils ont mis a jour la doc de cette partie et plus aussi clair.  
   J'avais appris à l'utiliser avec la doc de la version 1.33.1 (qui d'ailleurs est tjs téléchargeable) et c'était super clair.
Je te conseillerai d'aller la voir car j'ai vu que tu posais pas mal de questions sur boost::function / bind / signal  et dans la doc de la version 1.33.1 j'avais vraiment trouvé mon bonheur :)

n°1739264
NounouRs
Non parce que c pas mon pied !
Posté le 30-05-2008 à 10:00:15  profilanswer
 

J'ai transcrit pour essai cet exemple : http://www.boost.org/doc/libs/1_35 [...] ondvar_ref
 
Et je me demande vraiment à quoi sert leur variable data_ready....    elle n'est jamais passé à false... elle ne sert à rien à mes yeux...
 

Code :
  1. // TestThread.cpp : Defines the entry point for the console application.
  2. //
  3. #include "stdafx.h"
  4. #include <conio.h>
  5. #include <string>
  6. #include <boost/thread/thread.hpp>
  7. #include <boost/bind.hpp>
  8. #include <boost/thread/mutex.hpp>
  9. #include <boost/thread/condition_variable.hpp>
  10. #define BOUCLES 50
  11. boost::condition_variable cond;
  12. boost::mutex mut;
  13. bool data_ready;
  14. void process_data();
  15. void retrieve_data();
  16. void prepare_data();
  17. void wait_for_data_to_process();
  18. void prepare_data_for_processing();
  19. // TODO: reference any additional headers you need in STDAFX.H
  20. // and not in this file
  21. using namespace std;
  22. void process_data(const char* nom)
  23. {
  24. string str = nom;
  25. str += "process_data\n";
  26. printf(str.c_str());
  27. //printf("process_data\n" );
  28.    //cout << nom << "process_data" << endl;
  29. }
  30. void retrieve_data(const char* nom)
  31. {
  32. //printf(nom);
  33. //printf("retrieve_data\n" );
  34. //cout << nom << "retrieve_data" << endl;
  35. }
  36. void prepare_data(const char* nom)
  37. {
  38. string str = nom;
  39. str += "prepare_data\n";
  40. printf(str.c_str());
  41. //printf(nom);
  42. //printf("prepare_data\n" );
  43. //cout << nom << "prepare_data" << endl;
  44. }
  45. void wait_for_data_to_process(const char* nom)
  46. {
  47.     boost::unique_lock<boost::mutex> lock(mut);
  48.     while(!data_ready)
  49.     {
  50.         cond.wait(lock);
  51.     }
  52.     process_data(nom);
  53. }
  54. void prepare_data_for_processing(const char* nom)
  55. {
  56.     retrieve_data(nom);
  57.     prepare_data(nom);
  58.     {
  59.         boost::lock_guard<boost::mutex> lock(mut);
  60.         data_ready=true;
  61.     }
  62.     //cond.notify_one();
  63. cond.notify_all();
  64. }
  65. //------------------
  66. void loopProcess(const char* nom)
  67. {
  68. int plein1 = 0;
  69. while(plein1 < BOUCLES) {
  70.  wait_for_data_to_process(nom);
  71.  plein1++ ;
  72.  Sleep(70);
  73. }
  74. }
  75. void loopPrepare(const char* nom)
  76. {
  77. int plein2 = 0;
  78. while(plein2 < BOUCLES) {
  79.  prepare_data_for_processing(nom);
  80.  plein2++;
  81.  Sleep(200);
  82. }
  83. }
  84. int _tmain(int argc, _TCHAR* argv[])
  85. {
  86. boost::thread thread1(boost::bind(loopProcess, "n1 - " ));
  87. boost::thread thread2(boost::bind(loopPrepare, "n2 - " ));
  88. /* faire 2 thread, et */
  89. getch();
  90. return 0;
  91. }

n°1739438
NounouRs
Non parce que c pas mon pied !
Posté le 30-05-2008 à 16:12:59  profilanswer
 

Comment faire un wait / notify avec boost thread,   ce que j'ai ecrit ci dessus ne fait pas du tout ce que je veux... moi je veux un wait notify à la Java....    
wait = unlock, j'attend un peu, lock
notify = je reveille les lock immédiatement
 
Et normalement, ca se lance sur un mutex... mais là (ces cons là) ils le lancent sur un boost::condition... comment ca marche ce truc


Message édité par NounouRs le 30-05-2008 à 16:13:38
n°1757191
NounouRs
Non parce que c pas mon pied !
Posté le 09-07-2008 à 09:06:40  profilanswer
 

PROBLEME DE THREADS, LE RETOUR
 
J'ai une class singleton (pas le singleton de boost, je l'ai codé moi-même) et donc, il faut l'appeler avec MaClass::getInstance()     et là dedans, je souhaite lancer dans un thread une de ses méthodes ( MaClass::launchEventLoop() )
Pour faire ce thread, je souhaite utiliser boost::thread
 
Je maitrise la technique pour lancer une méthode de class : boost::thread(boost::bind (MaClass::maMethode , arg1, arg2 )) ;
 
Par contre, ca commence à legerement se corser lorsqu'il s'agit de lancer cela en ayant récupéré l'instance de singleton avant...
 
Est ce que vous savez faire.... je suis sur une piste (surement mauvaise) avec boost::ref

n°1757196
Joel F
Real men use unique_ptr
Posté le 09-07-2008 à 09:18:13  profilanswer
 

qu'as tu écris là déjà ?

n°1757217
NounouRs
Non parce que c pas mon pied !
Posté le 09-07-2008 à 10:28:40  profilanswer
 

La ce qu'il me faudrait, c'est un tutoriel où on aborderai les usages croisés de :
boost::thread
boost::ref
boost::bind
boost::function
 
parce que bon, merci les doc boost, mais c bon pour déposer un brevet, pas pour expliquer comment ca marche !!!!

n°1757218
NounouRs
Non parce que c pas mon pied !
Posté le 09-07-2008 à 10:36:40  profilanswer
 

Alors, j'ai un programme deja complet travaillant en evenementiel (Downloader - Core - GUI ), mais je souhaite déplacer une de mes classes (la classe principale de download) en element threadé
 
C'est la toute première de mes classes sur laquelle je rencontre mon problème, j'explique :
 
J'ai une classe abstraite de laquelle j'hérite avec quasiment toutes mes autres classes (le Core, le GUI, et maintenant Downloader) : Singleton :
 

Code :
  1. #ifndef _SINGLETON_H_
  2. #define _SINGLETON_H_
  3. namespace TRUC
  4. {
  5. template <typename T>
  6. class Singleton
  7. {
  8. protected:
  9.  // Constructeur/destructeur
  10.   Singleton () { }
  11.  ~Singleton () {}
  12. public:
  13.  // Interface publique
  14.  static T *getInstance ()
  15.  {
  16.   if (NULL == _singleton)
  17.   {
  18.    _singleton = new T;
  19.   }
  20.   return (static_cast<T*> (_singleton));
  21.  }
  22.  static void kill ()
  23.  {
  24.   if (NULL != _singleton)
  25.   {
  26.    delete _singleton;
  27.    _singleton = NULL;
  28.   }
  29.  }
  30. private:
  31.  // Unique instance
  32.  static T *_singleton;
  33. };
  34. template <typename T>
  35. T *Singleton<T>::_singleton = NULL;
  36. } // namespace TRUC
  37. #endif // _SINGLETON_H_


 
Elle me permet d'avoir une seule instance de classe, je les appelle comme ca : MaClasse::getInstance()->etc
 
C'est là que se situe le probleme.
 
J'ai la classe Downloader dont je parlait : qui devra avoir la signature suivante :  
class Downloader: public Singleton<Downloader>, public EventHandler
 
La classe EventHandler a une methode void runEventLoop(long timeoutMs = 100L);   qui lance la lecture en boucle d'une liste d'evemenents.
Pour que ca marche, il faut que runEventLoop soit lancé dans un thread independant.
 
Hors, je rappelle que Downloader est aussi un singleton...  
 
Je n'arrive pas à faire l'appel dans Boost::thread de ma methode runEventLoop tout en établissant bien le lien sur mon objet unique (siingleton) via Downloader::getInstance()
 
 
En fait, je pense faire cette création de thread dans le constructeur de Downloader... c'est surement pas là qu'il faut le faire...   que me conseilles tu ?
-----
 
Voici la forme batarde de ce que ca devrait faire :
 
boost::thread(Downloader::getInstance()->runEventLoop(100L));
Evidement, ca compile pas ca...
J'ai un peu tenté des trucs avec boost::function, boost::bind boost::ref.... ya surement un arrangement à trouver, mais je ne l'ai pas encore trouvé


Message édité par NounouRs le 09-07-2008 à 10:41:52
n°1757244
Joel F
Real men use unique_ptr
Posté le 09-07-2008 à 11:22:48  profilanswer
 

boost::thread attends un boost::function ou un type équivalent.
 
Downloader::getInstance()->runEventLoop(100L) c'est pas un pointeur de fonction ni un boost::function, c'est du type de retour de runEventLoop.
 
Ce que tu veux faire c'est un truc genre :
 
boost::thread( boost::bind(&Downloader::runEventLoop, 100L) );  
 
et ça devrait marcher car bind renvoie un objet function correct.
Essaye et dis moi.
 
La page a lire pour se depatouiller de bidn :
http://www.boost.org/doc/libs/1_35 [...] leshooting

n°1757401
NounouRs
Non parce que c pas mon pied !
Posté le 09-07-2008 à 15:52:59  profilanswer
 

Avec :
boost::thread( boost::bind(&Downloader::runEventLoop, 100L) );  
J'ai droit à ca :

1>Compiling...
1>Downloader.cpp
1>w:\truc\src\net\downloader.cpp(32) : error C3867: 'truc::EventHandler::runEventLoop': function call missing argument list; use '&truc::EventHandler::runEventLoop' to create a pointer to member
1>w:\truc\src\net\downloader.cpp(32) : error C2143: syntax error : missing ')' before 'constant'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<_bi::dm_result<MT::* ,A1>::type,boost::_mfi::dm<M,T>,_bi::list_av_1<A1>::type> boost::bind(M T::* ,A1)' : expects 2 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1666) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf8<R,T,A1,A2,A3,A4,A5,A6,A7,A8>,_bi::list_av_9<A1,A2,A3,A4,A5,A6,A7,A8,A9>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7,B8) const,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 10 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(222) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf8<R,T,A1,A2,A3,A4,A5,A6,A7,A8>,_bi::list_av_9<A1,A2,A3,A4,A5,A6,A7,A8,A9>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7,B8),A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 10 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(211) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf7<R,T,A1,A2,A3,A4,A5,A6,A7>,_bi::list_av_8<A1,A2,A3,A4,A5,A6,A7,A8>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7) const,A1,A2,A3,A4,A5,A6,A7,A8)' : expects 9 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(198) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf7<R,T,A1,A2,A3,A4,A5,A6,A7>,_bi::list_av_8<A1,A2,A3,A4,A5,A6,A7,A8>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6,B7),A1,A2,A3,A4,A5,A6,A7,A8)' : expects 9 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(187) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf6<R,T,A1,A2,A3,A4,A5,A6>,_bi::list_av_7<A1,A2,A3,A4,A5,A6,A7>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6) const,A1,A2,A3,A4,A5,A6,A7)' : expects 8 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(174) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf6<R,T,A1,A2,A3,A4,A5,A6>,_bi::list_av_7<A1,A2,A3,A4,A5,A6,A7>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5,B6),A1,A2,A3,A4,A5,A6,A7)' : expects 8 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(163) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf5<R,T,A1,A2,A3,A4,A5>,_bi::list_av_6<A1,A2,A3,A4,A5,A6>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5) const,A1,A2,A3,A4,A5,A6)' : expects 7 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(150) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf5<R,T,A1,A2,A3,A4,A5>,_bi::list_av_6<A1,A2,A3,A4,A5,A6>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4,B5),A1,A2,A3,A4,A5,A6)' : expects 7 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(139) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf4<R,T,A1,A2,A3,A4>,_bi::list_av_5<A1,A2,A3,A4,A5>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4) const,A1,A2,A3,A4,A5)' : expects 6 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(126) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf4<R,T,A1,A2,A3,A4>,_bi::list_av_5<A1,A2,A3,A4,A5>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3,B4),A1,A2,A3,A4,A5)' : expects 6 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(115) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf3<R,T,A1,A2,A3>,_bi::list_av_4<A1,A2,A3,A4>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3) const,A1,A2,A3,A4)' : expects 5 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(102) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf3<R,T,A1,A2,A3>,_bi::list_av_4<A1,A2,A3,A4>::type> boost::bind(R (__thiscall T::* )(B1,B2,B3),A1,A2,A3,A4)' : expects 5 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(91) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf2<R,T,A1,A2>,_bi::list_av_3<A1,A2,A3>::type> boost::bind(R (__thiscall T::* )(B1,B2) const,A1,A2,A3)' : expects 4 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(78) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf2<R,T,A1,A2>,_bi::list_av_3<A1,A2,A3>::type> boost::bind(R (__thiscall T::* )(B1,B2),A1,A2,A3)' : expects 4 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(67) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf1<R,T,A1>,_bi::list_av_2<A1,A2>::type> boost::bind(R (__thiscall T::* )(B1) const,A1,A2)' : expects 3 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(54) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf1<R,T,A1>,_bi::list_av_2<A1,A2>::type> boost::bind(R (__thiscall T::* )(B1),A1,A2)' : expects 3 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(43) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::cmf0<R,T>,_bi::list_av_1<A1>::type> boost::bind(R (__thiscall T::* )(void) const,A1)' : expects 2 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(30) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,boost::_mfi::mf0<R,T>,_bi::list_av_1<A1>::type> boost::bind(R (__thiscall T::* )(void),A1)' : expects 2 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_mf_cc.hpp(20) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2,B3,B4,B5,B6,B7,B8,B9),_bi::list_av_9<A1,A2,A3,A4,A5,A6,A7,A8,A9>::type> boost::bind(R (__cdecl *)(B1,B2,B3,B4,B5,B6,B7,B8,B9),A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 10 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(112) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2,B3,B4,B5,B6,B7,B8),_bi::list_av_8<A1,A2,A3,A4,A5,A6,A7,A8>::type> boost::bind(R (__cdecl *)(B1,B2,B3,B4,B5,B6,B7,B8),A1,A2,A3,A4,A5,A6,A7,A8)' : expects 9 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(101) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2,B3,B4,B5,B6,B7),_bi::list_av_7<A1,A2,A3,A4,A5,A6,A7>::type> boost::bind(R (__cdecl *)(B1,B2,B3,B4,B5,B6,B7),A1,A2,A3,A4,A5,A6,A7)' : expects 8 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(90) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2,B3,B4,B5,B6),_bi::list_av_6<A1,A2,A3,A4,A5,A6>::type> boost::bind(R (__cdecl *)(B1,B2,B3,B4,B5,B6),A1,A2,A3,A4,A5,A6)' : expects 7 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(79) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2,B3,B4,B5),_bi::list_av_5<A1,A2,A3,A4,A5>::type> boost::bind(R (__cdecl *)(B1,B2,B3,B4,B5),A1,A2,A3,A4,A5)' : expects 6 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(68) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2,B3,B4),_bi::list_av_4<A1,A2,A3,A4>::type> boost::bind(R (__cdecl *)(B1,B2,B3,B4),A1,A2,A3,A4)' : expects 5 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(57) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2,B3),_bi::list_av_3<A1,A2,A3>::type> boost::bind(R (__cdecl *)(B1,B2,B3),A1,A2,A3)' : expects 4 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(46) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1,B2),_bi::list_av_2<A1,A2>::type> boost::bind(R (__cdecl *)(B1,B2),A1,A2)' : expects 3 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(35) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,R(__cdecl *)(B1),_bi::list_av_1<A1>::type> boost::bind(R (__cdecl *)(B1),A1)' : expects 2 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_cc.hpp(26) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_9<A1,A2,A3,A4,A5,A6,A7,A8,A9>::type> boost::bind(F,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 10 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1485) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_8<A1,A2,A3,A4,A5,A6,A7,A8>::type> boost::bind(F,A1,A2,A3,A4,A5,A6,A7,A8)' : expects 9 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1477) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_7<A1,A2,A3,A4,A5,A6,A7>::type> boost::bind(F,A1,A2,A3,A4,A5,A6,A7)' : expects 8 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1469) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_6<A1,A2,A3,A4,A5,A6>::type> boost::bind(F,A1,A2,A3,A4,A5,A6)' : expects 7 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1461) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_5<A1,A2,A3,A4,A5>::type> boost::bind(F,A1,A2,A3,A4,A5)' : expects 6 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1453) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_4<A1,A2,A3,A4>::type> boost::bind(F,A1,A2,A3,A4)' : expects 5 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1445) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_3<A1,A2,A3>::type> boost::bind(F,A1,A2,A3)' : expects 4 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1437) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_2<A1,A2>::type> boost::bind(F,A1,A2)' : expects 3 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1429) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<boost::_bi::unspecified,F,_bi::list_av_1<A1>::type> boost::bind(F,A1)' : expects 2 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1421) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_9<A1,A2,A3,A4,A5,A6,A7,A8,A9>::type> boost::bind(boost::type<T>,F,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 11 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1401) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_8<A1,A2,A3,A4,A5,A6,A7,A8>::type> boost::bind(boost::type<T>,F,A1,A2,A3,A4,A5,A6,A7,A8)' : expects 10 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1393) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_7<A1,A2,A3,A4,A5,A6,A7>::type> boost::bind(boost::type<T>,F,A1,A2,A3,A4,A5,A6,A7)' : expects 9 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1385) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_6<A1,A2,A3,A4,A5,A6>::type> boost::bind(boost::type<T>,F,A1,A2,A3,A4,A5,A6)' : expects 8 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1377) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_5<A1,A2,A3,A4,A5>::type> boost::bind(boost::type<T>,F,A1,A2,A3,A4,A5)' : expects 7 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1369) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_4<A1,A2,A3,A4>::type> boost::bind(boost::type<T>,F,A1,A2,A3,A4)' : expects 6 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1361) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_3<A1,A2,A3>::type> boost::bind(boost::type<T>,F,A1,A2,A3)' : expects 5 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1353) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_2<A1,A2>::type> boost::bind(boost::type<T>,F,A1,A2)' : expects 4 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1345) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_1<A1>::type> boost::bind(boost::type<T>,F,A1)' : expects 3 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1337) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,boost::_bi::list0> boost::bind(boost::type<T>,F)' : expects 2 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1329) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_9<A1,A2,A3,A4,A5,A6,A7,A8,A9>::type> boost::bind(F,A1,A2,A3,A4,A5,A6,A7,A8,A9)' : expects 10 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1319) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_8<A1,A2,A3,A4,A5,A6,A7,A8>::type> boost::bind(F,A1,A2,A3,A4,A5,A6,A7,A8)' : expects 9 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1311) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_7<A1,A2,A3,A4,A5,A6,A7>::type> boost::bind(F,A1,A2,A3,A4,A5,A6,A7)' : expects 8 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1303) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_6<A1,A2,A3,A4,A5,A6>::type> boost::bind(F,A1,A2,A3,A4,A5,A6)' : expects 7 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1295) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_5<A1,A2,A3,A4,A5>::type> boost::bind(F,A1,A2,A3,A4,A5)' : expects 6 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1287) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_4<A1,A2,A3,A4>::type> boost::bind(F,A1,A2,A3,A4)' : expects 5 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1279) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_3<A1,A2,A3>::type> boost::bind(F,A1,A2,A3)' : expects 4 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1271) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_2<A1,A2>::type> boost::bind(F,A1,A2)' : expects 3 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1263) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2780: 'boost::_bi::bind_t<R,F,_bi::list_av_1<A1>::type> boost::bind(F,A1)' : expects 2 arguments - 1 provided
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(1255) : see declaration of 'boost::bind'
1>w:\truc\src\net\downloader.cpp(32) : error C2059: syntax error : ')'


 
et avec :
boost::thread( boost::bind(&Downloader::runEventLoop, _1, 100L) );
J'ai droit à ca :

Downloader.cpp
1>c:\boost_tri\include\boost-1_35\boost\bind.hpp(289) : error C2784: 'result_traits<R,F>::type boost::_bi::list0::operator [](const boost::_bi::bind_t<R,F,L> & ) const' : could not deduce template argument for 'overloaded function type' from 'overloaded function type'
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(164) : see declaration of 'boost::_bi::list0::operator []'
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_template.hpp(20) : see reference to function template instantiation 'void boost::_bi::list2<A1,A2>::operator ()<F,boost::_bi::list0>(boost::_bi::type<T>,F &,A &,int)' being compiled
1>        with
1>        [
1>            A1=boost::arg<1>,
1>            A2=boost::_bi::value<long>,
1>            F=boost::_mfi::mf1<void,truc::EventHandler,long>,
1>            T=void,
1>            A=boost::_bi::list0
1>        ]
1>        c:\boost_tri\include\boost-1_35\boost\bind\bind_template.hpp(18) : while compiling class template member function 'void boost::_bi::bind_t<R,F,L>::operator ()(void)'
1>        with
1>        [
1>            R=void,
1>            F=boost::_mfi::mf1<void,truc::EventHandler,long>,
1>            L=boost::_bi::list2<boost::arg<1>,boost::_bi::value<long>>
1>        ]
1>        w:\truc\src\net\downloader.cpp(31) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>        with
1>        [
1>            R=void,
1>            F=boost::_mfi::mf1<void,truc::EventHandler,long>,
1>            L=boost::_bi::list2<boost::arg<1>,boost::_bi::value<long>>
1>        ]
1>c:\boost_tri\include\boost-1_35\boost\bind.hpp(289) : error C2784: 'result_traits<R,F>::type boost::_bi::list0::operator [](boost::_bi::bind_t<R,F,L> & ) const' : could not deduce template argument for 'overloaded function type' from 'overloaded function type'
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(162) : see declaration of 'boost::_bi::list0::operator []'
1>c:\boost_tri\include\boost-1_35\boost\bind.hpp(289) : error C2784: 'T &boost::_bi::list0::operator [](const boost::reference_wrapper<T> & ) const' : could not deduce template argument for 'overloaded function type' from 'overloaded function type'
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(160) : see declaration of 'boost::_bi::list0::operator []'
1>c:\boost_tri\include\boost-1_35\boost\bind.hpp(289) : error C2784: 'const T &boost::_bi::list0::operator [](const boost::_bi::value<T> & ) const' : could not deduce template argument for 'overloaded function type' from 'overloaded function type'
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(158) : see declaration of 'boost::_bi::list0::operator []'
1>c:\boost_tri\include\boost-1_35\boost\bind.hpp(289) : error C2784: 'T &boost::_bi::list0::operator [](boost::_bi::value<T> & ) const' : could not deduce template argument for 'overloaded function type' from 'overloaded function type'
1>        c:\boost_tri\include\boost-1_35\boost\bind.hpp(156) : see declaration of 'boost::_bi::list0::operator []'
1>c:\boost_tri\include\boost-1_35\boost\bind.hpp(289) : error C2676: binary '[' : 'boost::_bi::list0' does not define this operator or a conversion to a type acceptable to the predefined operator

n°1757446
NounouRs
Non parce que c pas mon pied !
Posté le 09-07-2008 à 16:55:20  profilanswer
 

Je veux dire, si je lance une autre fonction en thread, ca marche très bien, mais là, c'est une méthode hérité (non virtuelle) de EventHandler, et ca foire surement pour ca !
 
Marche très bien :
boost::thread( boost::bind(Downloader::getLink, url) );
 
 
Boost::thread n'aime-t-il pas les héritages ?
 
Là franchement, ca commence à me gaver, c'est comme si on faisait du C++ sans avoir droit à l'heritage !!!! Le comble.


Message édité par NounouRs le 09-07-2008 à 17:24:40
n°1757911
NounouRs
Non parce que c pas mon pied !
Posté le 10-07-2008 à 14:45:41  profilanswer
 

Bon, je suis pas un rat, je vais montrer la syntax qui a marché dans mon cas :

Code :
  1. if (!isEventLoopRunning())  {
  2.   TRACE("this : %p", this);
  3.   boost::thread( boost::bind( &Downloader::runEventLoop, this, 50 ) );
  4.  }


 
=============================
 
Maintenant, je voudrais poser une question concernant Boost::tuple, ca avait l'air génial sur le papier, mais ca chie dans la colle en pratique,
 
J'essaye d'ecrire dans une champ avec la syntaxe : monTuple.get<1> = maValeur ;   mais ca marche pas !!!!
voici une sequence de code, où la valeur n'est pas modifiée :
 

Code :
  1. void Downloader::consumer(const int num)
  2. {
  3.  while(((URLElem)*it).get<0>() != num && it != end)
  4.   ++it;
  5.  if ( ((URLElem)*it).get<0>() == num ) {
  6.   download_id id1 = ((URLElem)*it).get<1>(); // vaut 0 avant
  7.   ((URLElem)*it).get<1>() = DOWNLOADING;  // Downloading vaut 1
  8.   download_id id2 = ((URLElem)*it).get<1>(); // vaut toujours 0, mais pourquoi moi, commandant Cousteau, nous sommes des millions !
  9.   getFile(((URLElem)*it).get<0>(), ((URLElem)*it).get<2>(), ((URLElem)*it).get<3>(), this);
  10.  }
  11. }

n°1758074
Joel F
Real men use unique_ptr
Posté le 10-07-2008 à 18:12:14  profilanswer
 

.get<I> marche mal sous visual, utilsie :
 
get<1>(monTuple);

mood
Publicité
Posté le   profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  Un usage de boost::function dans un appel à boost::thread

 

Sujets relatifs
[FLASH7]Appel de fonctions de scripts externesUsage de Singleton de Boost::Detail::Thread ?
Pourquoi Boost n'implemente pas sa class STRING ?Urgent ! Appel d'une page html en perl
VISUAL Intégrer une librairie directement dans un executable (boost+)Appel périodique d'une fonction??
Appel d'une fonctionCall to undefined function
Plus de sujets relatifs à : Un usage de boost::function dans un appel à boost::thread


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR