命名空间的坑

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

posted @ 2014-07-24 15:14  core!  阅读(112)  评论(0编辑  收藏  举报