Meaning of double bracket “[[foo()]] type name;” syntax in c++?

前端 未结 1 936
醉梦人生
醉梦人生 2021-01-01 11:20

In this article about avoiding False Sharing, the following code snipped for alignment is presented:

// C++ (using C++0x alignment syntax)
template

        
相关标签:
1条回答
  • 2021-01-01 11:44

    That is the attribute specifier syntax. It was introduced as a unified syntax to access what were formerly compiler-specific extensions (now some are standardized).

    In this case the code is telling the compiler to align data to CACHE_LINE_SIZE bytes.

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