我重载操作< <的std :: ENDL是未知类型的<<
template <Typename T>
UIStream& operator<<(const T);
UIStream my_stream;
my_stream << 10 << " heads";
作品,但:
my_stream << endl;
给出编译错误:
error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'UIStream' (or there is no acceptable conversion)
什么是为了使my_stream << endl
工作的工作?
不知道有关UIStream什么,这是一个有点难以评论。 – 2009-07-15 22:22:39
然而,你找到了一个方法。 :) – notJim 2009-07-15 22:57:09