static-keyword

Hello!

I've heard the static-keyword would be deprecated, meaning it's use should be discouraged. From what I've understood, C++ standard has made some attempts to make alternative routes to prevent it's use, especially via anonymous namespaces. However, this only raises the question, has there made any attempts to discourage the use of static-keyword in function body, and if so, how can one do this the other way?

Example:
1
2
3
void function(void){
    static int hello;
}

Last edited on
The static keyword itself was never deprecated, just its use for specifying internal linkage in that context.
It is no longer deprecated in C++11, in any case.
Topic archived. No new replies allowed.