Possible Duplicate:
Deprecation of the static keyword… no more?
In C++2003, namespace-static
is deprecated:
[C++03: 7.3.1.1/2]:
The use of thestatic
keyword is deprecated when declaring objects in a namespace scope (see annex D); the unnamed-namespace provides a superior alternative.
I can't find where any such clause exists in C++2011 (suggesting undeprecation), and 7.1.1
doesn't seem to prohibit namespace-static
(and if it had, this would suggest that the feature had been finally removed from the language); however, neither case is listed in C.2
(which itemises significant differences between 2003 and 2011).
Was namespace-static
undeprecated or not?
Undeprecating namespace-static
was proposed and accepted for n3296:
ID: FI 6
Ref: D.2 [depr.static] ¶ Paragraph 1
Comment: The use of static in namespace scope should not be deprecated. Anonymous namespaces are not a sufficient replacement for the functionality.
Proposed Resolution: Strike [depr.static] completely.
Owner: CWG
Issue: 1012
Disposition: ACCEPTED
In fact, clause C (on compatibility) does not list any changes made to clause D (on deprecation), so it's hard to tell "at a glance". But, no, namespace-static
is no longer deprecated in C++11.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With