free hit counter

Wednesday, December 28, 2005

declaring functions static is passe

OMG, It's like, so C to declare a function static.

I guess static is an overused keyword.

You should now declare funtions you don't want called outside of this file (excuse me, "translation unit")in an unnamed namespace like this:


//static functions and data that shouldn't be referenced outside this file
namespace
{
int foo();
void bar();
std::string baz;
}



linkage

0 Comments:

Post a Comment

<< Home