C++ “namespace scope”

后端 未结 1 745
抹茶落季
抹茶落季 2021-01-21 15:01

The C++ spec (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf, section 7.5.4) states that

A linkage-specification shall occur only in nam

1条回答
  •  -上瘾入骨i
    2021-01-21 15:58

    It means, that extern "C" should be only in namespace-scope (not class-scope, block-scope etc.) Something, that is not in namespace, but is in global scope - is in global namespace scope.

    The potential scope denoted by an original-namespace-name is the concatenation of the declarative regions established by each of the namespace-definitions in the same declarative region with that original-namespace-name.

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