ostringstream是一个未定义的类型

ostringstream is an undefined type?

本文关键字:一个 未定义 类型 ostringstream      更新时间:2023-10-16

在我的C++项目中,我正在尝试这样做:

 std::ostringstream stream(std::ostringstream::out);

但我得到了一个错误:

error C2027: use of undefined type 'std::basic_ostringstream<_Elem,_Traits,_Alloc>'

我已经包含了iostream和ostream库,所以我不确定为什么它将ostringstream视为未定义的。。。

std::ostringstream<sstream>中定义。<iostream>只包含一个正向声明,而<ostream>根本没有帮助。