#
An unnamed-namespace-definition behaves as if it were replaced by
inline
where inline appears if and only if it appears in the unnamed-namespace-definition and all occurrences of unique in a translation unit are replaced by the same identifier, and this identifier differs from all other identifiers in the program.
The optional attribute-specifier-seq in the unnamed-namespace-definition appertains to unique.
[Example 1: namespace { int i; } / unique​::​i void f() { i++; } / unique​::​i++ namespace A { namespace { int i; / A​::​unique​::​i int j; / A​::​unique​::​j } void g() { i++; } / A​::​unique​::​i++ } using namespace A; void h() { i++; / error: unique​::​i or A​::​unique​::​i A::i++; / A​::​unique​::​i j++; / A​::​unique​::​j } — end example]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant