Binding a static function in a namespace in C ++

What is the relationship of a static function declared in a non-global namespace?

Example:

namespace foo { ... static void bar(int a) { } } 

Is this something other than a static method declared in the global namespace? Can someone point me to the place in the standard where this is laid out?

Thanks!

+4
source share
1 answer

static when used in a function at the namespace level means internal binding.

A specific quote will be taken from Section 3.5, β€œLinking Programs,” paragraph 3:

A name that has a namespace scope (3.3.6) has an internal relationship if that name

  • a template for a variable, function, or function that is explicitly declared static; or, [...]
+7
source

All Articles