A
anon
Hello
Can anyone tell me how to define constants private to a implementation
file. That is, I do not want to put them in a global namespace, but to
narrow their scope only to one implementation file.
Will this work:
static const int i=1;
?
Or is this better:
namespace
{
const int i=1;
}
?
If I do this:
const int i = 1;
am I going to pollute global namespace?
Thanks in advance.
Can anyone tell me how to define constants private to a implementation
file. That is, I do not want to put them in a global namespace, but to
narrow their scope only to one implementation file.
Will this work:
static const int i=1;
?
Or is this better:
namespace
{
const int i=1;
}
?
If I do this:
const int i = 1;
am I going to pollute global namespace?
Thanks in advance.