Does the C++ volatile keyword introduce a memory fence?

前端 未结 13 2020
一整个雨季
一整个雨季 2020-11-28 20:40

I understand that volatile informs the compiler that the value may be changed, but in order to accomplish this functionality, does the compiler need to introduc

相关标签:
13条回答
  • 2020-11-28 21:31

    It depends on which compiler "the compiler" is. Visual C++ does, since 2005. But the Standard does not require it, so some other compilers do not.

    0 讨论(0)
提交回复
热议问题