c ++: how can I throw an error with the file and the linen number?

I try to use BOOST_THROW_EXCEPTION To do this, here is an example:

void demo_boost_throw()
    BOOST_THROW_EXCEPTION(std::runtime_error("boost throw std exception."));
int main() {
    return 0;

From here we can see what the file contains

        ::boost::throw_exception( ::boost::enable_error_info(x) <<
        ::boost::throw_function(BOOST_THROW_EXCEPTION_CURRENT_FUNCTION) <<
        ::boost::throw_file(__FILE__) <<
        ::boost::throw_line((int)__LINE__) )

But when I run the program, it doesn't print the file and the line.