move boost::throw_exception implementation in main.cpp