コード例 #1
0
 void throw_(typename Exception::error_code code, S1 msg, Pos const& pos)
 {
     std::stringstream stream;
     stream << Exception::severity_text(code) << ": "
            << Exception::error_text(code);
     if (msg[0] != 0) 
         stream << ": " << msg;
     stream << std::ends;
     std::string throwmsg = stream.str(); 
     boost::throw_exception(Exception(throwmsg.c_str(), code,
         pos.get_line(), pos.get_column(), pos.get_file().c_str()));
 }
コード例 #2
0
 void throw_(Context& ctx, typename Exception::error_code code, 
     S1 msg, Pos const& pos, S2 name)
 {
     std::strstream stream;
     stream << Exception::severity_text(code) << ": "
            << Exception::error_text(code);
     if (msg[0] != 0) 
         stream << ": " << msg;
     stream << std::ends;
     std::string throwmsg = stream.str(); stream.freeze(false);
     ctx.get_hooks().throw_exception(ctx.derived(), 
         Exception(throwmsg.c_str(), code, pos.get_line(), pos.get_column(), 
             pos.get_file().c_str(), name));
 }