Resultados de la búsqueda a petición "boost-foreach"

6 la respuesta

Interate sobre todos los archivos en un directorio usando BOOST_FOREACH

¿Puede iterar sobre todos los archivos en un directorio usando boost :: filesystem y BOOST_FOREACH? Lo intent path dirPath = ... int fileCount = 0; BOOST_FOREACH(const path& filePath, dirPath) if(is_regular_file(filePath)) ++fileCount; Este ...

4 la respuesta

¿Cómo puedo iterar sobre dos vectores simultáneamente usando BOOST_FOREACH?

Me gustaría replicar lo siguiente con BOOST FOREACH std::vector<int>::const_iterator i1; std::vector<int>::const_iterator i2; for( i1 = v1.begin(), i2 = v2.begin(); i1 < v1.end() && i2 < v2.end(); ++i1, ++i2 ) { doSomething( *i1, *i2 ); }