« Return to Thread: Why can't I catch this exception in boost::thread?

Why can't I catch this exception in boost::thread?

by af001 :: Rate this Message:

Reply to Author | View in Thread

#include <boost/thread/thread.hpp>
#include <iostream>
#include <exception>

void helloworld()
{
    std::cout << "Hello World!" << std::endl;
        throw(std::string("err"));
}

int main()
{
        try
        {
                boost::thread thrd(&helloworld);
                thrd.join();
        }
        catch(...)
        {
                std::cout<<"err";
        }
}

 « Return to Thread: Why can't I catch this exception in boost::thread?