我有以下代码: #include <fstream>
// Removing this namespace (keeping the content) makes it work
namespace baz {
class Bar {
};
}
std::ostream & operator<<(std::ostream & stream, baz::Bar & value)
我对C++很陌生,我试图打印出一个机构的向量,这是我创建的一种对象类型。该对象的创建和我的程序的其余部分运行得很好,但是当我尝试打印出该向量时,“< <”给出了一个错误,指出“操作数类型是std :: ostream”。 void PrintVector(const vector<Institution> &institutions)
{
for (int x = 0; x < ins