我在用ctemplate渲染htm文件时出现std::bad_alloc错误
std::string html;
ctemplate::Template *tpl = ctemplate::Template::GetTemplate(templateHtmlPath + "all_questions.html", ctemplate::DO_NOT_STRIP);
try {
tpl->Expand(&html, &root);
} catch (const std::exception &e) {
LOG_ERROR << "tpl->Expand view error. err message is: " << e.what() << std::endl;
html = "我真服了";
}
return html;
打印出的异常信息是:tpl->Expand view error. err message is: std::bad_alloc
现在我能确保 html文件路径没问题,tpl不为空指针