Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以将 C++ 输出流绑定到另一个输出流?
我之所以问,是因为我用 C++ 编写了一个 ISAPI 扩展,并且围绕 WriteClient 和 ServerSupportFunction/HSE_REQ_SEND_RESPONSE_HEADER_EX 函数编写了 ostream——一个用于 HTTP 标头,一个用于 HTTP 响应的正文。我想将流捆绑在一起,以便在发送其余响应之前发送所有 HTTP 标头。
是的你可以:
out1.tie( & out2 );
其中两个输出都是输出流。out2 将在输出到 out1 之前被刷新。