我正在尝试 this answer 中提供的优雅解决方案但无论我尝试什么,我都无法通过此行的错误 Implicit instantiation of undefined template
:
std::ostringstream strs;
我需要做什么?我已经包括了以下内容,我敢肯定这是矫枉过正的。作为第二个问题,似乎很难找到 ostringstream 究竟需要包含哪些内容:
#include <iostream>
#include <fstream>
#include <iosfwd>
#include <ios>
最佳答案
stringstream
类定义在 sstream
头中,所以写
#include <sstream>
一切都会好起来的。
关于c++ - ostringstream 给了我隐式实例化错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16167065/