命名空间的坑
.h
namespace xxx
{
struct yyy
{}
stream& operater <<(stream& in,yyy& a);
}
.cpp
stream& operater <<(stream& in,yyy& a){}; //error 可以编译,但是某个地方用到这个重载的话,将会有链接问题
stream& xxx::operater <<(stream& in,yyy& a){};
作者:sdu20112013
如果您觉得阅读本文对您有帮助,请点一下“推荐”按钮,您的“推荐”将是我最大的写作动力!欢迎转载,转载请注明出处.