J'ai un code du genre:
Je me disais qu'il devait y avoir une solution plus élégante, c'est à dire sans définition de structure (ou de fonction) à base de template, de bind1st, mem_fun et j'en passe
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 struct fax_fichier { std::string docNom; std::string docImp; enum { ETAPE_INIT, ETAPE_IMP_OK, ETAPE_IMP_KO, ETAPE_FIN } etape; }; typedef std::vector<fax_fichier> doc_type; doc_type m_docs; struct cmp { bool operator()(const fax_fichier& el) const { return el.etape == fax_fichier::ETAPE_IMP_OK; } }; return m_docs.size() == count_if( m_docs.begin(), m_docs.end(), cmp() );qui ferait la même chose !
Y a-t-il un gouroude la stl qui pourrait me donner l'astuce ?








qui ferait la même chose !
Répondre avec citation
Partager