The Code Master wrote:
I have been having a problem with namespaces. This may be a Win-MFC issue,
but am I correct that the following should have file level scope?
using namespace MyNamespace;
Is there a way for me to declare this to have program scope?
What I would like, is to have a namespace with commonly used functions and
classes, available with program scope.
Why put these functions into a namespace if the goal is to make them
available in the global namespace? The goal here would appear to be at
odds with the steps being taken.
For you with experience on many different types of compilers, is this
implemented differently on different compilers? In other words, could that
be the issue?
The issue would appear to be declaring the functions and classes in the
wrong namespace. Generally, the implementor places the interface to the
implementation in a namespace. Clients of the implementation can decide
to bring those names into their global namespace when and where they
wish. If the implementor decides that the interface should be in the
global namespace of every client, then he or she should simply declare
the interface in the global namespace to start with, rather than
declare it somewhere else and then have to figure out how to move it.
Greg