
23 Dec
2011
23 Dec
'11
3:45 p.m.
Here is the sample code that crashes every time i compile project as multibyte and not unicode and ahve user wchar_t as default type #include <boost/thread.hpp> #include <boost/filesystem.hpp> int main(void) { std::string sPath("c:\\Development"); boost::thread_group tg; for(int i = 0; i < 10; i++) { tg.create_thread([&sPath](){ boost::this_thread::sleep(boost::posix_time::milliseconds(10)); boost::filesystem::path p(sPath); boost::filesystem::directory_iterator di(p), end; while(di != end) std::cout << (*di).path().string() << std::endl; }); } tg.join_all(); }