boost::future handles std::exception differently from std::future on Windows
- Dominant language
- C++
- Stars
- 214
- Forks
- 171
- PR merge metrics
- No merged PRs in 30d
Description
I'm using VC++2019, I use boost::when_all since std::when_all is not available yet. But I find that boost::async will discard std::exception::what() and use 'Unknown exception' or 'std::exception' instead, on the other hand, std::async could handle the message as expected.
```
#include
#define BOOST_THREAD_PROVIDES_FUTURE
#include
#include
int main() {
auto f1 = boost::async([]{ // the program will print 'my exception' if this line uses 'std::async'.
try{
throw std::invalid_argument("my exception");
}
catch (const std::exception& e) {
throw e;
}
});
try {
f1.get();
}
catch (const std::exception& e) {
std::cout << e.what() << std::endl;
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.