命名空间的坑

.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){}; 

原文地址:https://www.cnblogs.com/sdu20112013/p/3865697.html