[Please do not mail me a copy of your followup]
Rosario19 <R...@invalid.invalid> spake the secret code
<
7g4noa93b8d33evd5...@4ax.com> thusly:
>On Tue, 23 Jun 2015 01:29:42 +0000 (UTC),
>
legaliz...@mail.xmission.com (Richard) wrote:
>>I've done:
>>- 'using namespace fmeh;' at file scope
>
>as someone said, namespace should be the name of file where there is
>the function in cpu instructions.
I don't think you quite understood what I was saying, so I'll elaborate.
I agree it is good advice to define all of your own code inside a
namespace. What you name that namespace is up to you; it is a subjective
decision to say that it "should" be the name of the file containing the
source code. There are other naming policies that are just as good.
So while I say you should put your code in a namespace, I refrain from
telling you what your namespace should be named.
When I say that I've done 'using namespace fmeh;' at file scope, I am
not referring to the namespace enclosing the definitions for that file.
I am using it similarly to an import statement in Java: a way to get
names from some other namespace visible in my source file without
having to be fully qualified.
When you put all your own code inside a namespace, you should never do
a file-scope using directive for the namespace where your code resides.
This makes the compiler do more work to resolve the names you're
attempting to define. Instead your code should be explicitly
surrounded by a named namespace definition.
>#define printf namedll.printf
>or
>#define P namedll.printf
I don't know what you're trying to propose with this, but such abuse of
the preprocessor is a really bad idea IMO.