sha*_*oth 11 c++ state language-lawyer observable-behavior
在C++ 03中,标准可观察行为(1.9/6)包括对库I/O函数的调用.现在我有这个代码:
printf( "" );
这正式调用了库I/O函数,但没有任何效果.
这是可观察的行为吗?是否允许编译器消除它?
MSa*_*ers 5
如果sync_with_stdio是,那肯定是可以观察到的true.当这是真的时,printf("")强制与std::cout输出同步,刷新先前缓冲的输出.
sync_with_stdio
true
printf("")
std::cout
归档时间:
14 年 前
查看次数:
738 次
最近记录:
10 年,2 月 前