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:

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

From here we can see what the file contains

#define BOOST_THROW_EXCEPTION(x)
        ::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.