What's the purpose of the unnamed namespace?
- by bbazso
In a .cpp file, if I decare a constant as follows:
namespace
{
const int UDP_PORT_MIN = 1024;
const int UDP_PORT_MAX = 65535;
}
vs. just:
const int UDP_PORT_MIN = 1024;
const int UDP_PORT_MAX = 65535;
What's the difference between these two?
I often see constant definitions declared in an unnamed namespace, so I was wondering what's the purpose of the unnamed namespace in this context?