Open Chudleyj opened 6 years ago
https://stackoverflow.com/questions/4725204/use-of-static-variables-and-functions-in-global-scope
Sent from my iPhone
On Oct 17, 2018, at 10:26 PM, Chudleyj notifications@github.com wrote:
Why are the functions in the empty name namespace static? g++ *.cpp -std=c++11 -ljsoncpp -lcurl -o exa.out && ./exa.out AMZN -a compiles fine without the static keyword.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
Empty namespace and static are redundant in this case aren’t they?
Yes, I believe empty namespaces are the C++ preferred way to ensure that a free function is local only to the translation unit.
Why are the functions in the empty name namespace static?
g++ *.cpp -std=c++11 -ljsoncpp -lcurl -o exa.out && ./exa.out AMZN -a
compiles fine without the static keyword.