ostringstream给了我隐式实例化错误

joh*_*ers 19 c++ string

我正在尝试这个答案中提供的优雅解决方案,但无论我尝试什么,我都无法通过Implicit instantiation of undefined template此行的错误:

std::ostringstream strs;

我需要做什么?我已经包括以下内容,我肯定是有点过分了.作为第二个问题,似乎很难找到确切需要包含在ostringstream中的内容:

#include <iostream>
#include <fstream>
#include <iosfwd>
#include <ios>
Run Code Online (Sandbox Code Playgroud)

For*_*veR 51

stringstream类在sstream头文件中定义,所以写

#include <sstream>
Run Code Online (Sandbox Code Playgroud)

一切都会好的.