我想再不动标准库的情况下增强下cin,cout,给他们多加点标识符(像endl这样的)。
想了半天还是想继承ostream。然后继承以后的类是没有输出的。
#include <iostream>
using namespace std;
//basic_ostream<char>就是ostream
//再iosfwd里有定义 typedef basic_ostream<char> ostream;
//这里我写过ostream也没用
class wio:public basic_ostream<char>
{
};
wio out;
int main()
{
out<<"hello";
return 0;
}