Can I assume an object declared in unnamed namespace to be equivalent to as if were static
?
namespace { int x; };// #1
static int x; // #2
FWIK, In both cases, x
will have static storage duration and internal linkage.
So does all the rules of an object declared as static
applies to an object in unnamed namespace?
For example:
- What will be the order of construction and destruction? will it be same?
- Can I use
extern
keyword withx
in unnamed namespace?