1) Can i use "using namespace xxx" when writing function bodies for "namespace xxx", for example:
namespace XXX
{
void SomeFunc ();
};
using namespace XXX;
void SomeFunc ()
{
printf ("Hello!");
}
2) If i have some nested namespaces defined in multiple files, do i have to include the file containing the namespace definition to use the namespace?
// In Foo.h
namespace BigSpace
{
namespace Foo
{
void FooFunc ();
}
}
// In Bar.h
namespace BigSpace
{
namespace Bar
{
void BarFunc ();
}
}
// In Bar.cpp
#include "Bar.h"
void BigSpace::Bar::BarFunc ()
{
BigSpace::Foo:FooFunc ();
}
would that run, or do i have to include "Foo.h". I''m hopeing so, because that way I can keep parts of the namespace hidden from other code modules unless they specifically need them.
thanks