【发布时间】:2013-04-23 10:30:45
【问题描述】:
我正在尝试this answer 中提供的优雅解决方案,但无论我尝试什么,我都无法通过此行的错误Implicit instantiation of undefined template:
std::ostringstream strs;
我需要做什么?我已经包括了以下内容,我敢肯定这是矫枉过正的。作为第二个问题,似乎很难找到 ostringstream 究竟需要包含哪些内容:
#include <iostream>
#include <fstream>
#include <iosfwd>
#include <ios>
【问题讨论】:
-
我看到了您提供的链接,如果您打算将 double 更改为字符串并且您支持 C++11,请使用
std::to_string(double)。