gpt4 book ai didi

c++ - ostringstream 给了我隐式实例化错误

转载 作者:IT老高 更新时间:2023-10-28 21:54:23 36 4
gpt4 key购买 nike

我正在尝试 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/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com