Synchronizing iostreams with printf-style I/O can be costly. cin and cout are by default synchronized with printf.
使用printf形式I / O的同步iostream代价会很高。cin和cout默认情况下与printf同步。
Example(示例)
int main()
{
ios_base::sync_with_stdio(false);
// ... use iostreams ...
}
???
原文链接
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#slio10-unless-you-use-printf-family-functions-call-ios_basesync_with_stdiofalse