I know that this is not good code. Just curious in understanding how to achieve it.
You can't.
Undecorated use of the variable aa
will use the one that is in the nearest scope.
Decorated use of the variable, ::aa
, will use the one that is in the scope outside the function.
Decorated use of the variable, <NS>::aa
, will use the one that is in the scope of the namespace <NS>
.