且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

C ++标准库:如何编写cout,cerr,cin和endl的包装器?

更新时间:2023-12-02 22:39:16

为什么不

using std::cin;
using std::cout;

等等?然后在你的代码中,你可以使用 cin cout ,等等,不会意外注入所有的 std 命名空间。

and so on? Then in your code you can use cin, cout, and so on, without accidentally injecting all of the rest of the std namespace into your code.