I have a small namespace containing some type definitions, which I use to make my code look cleaner. However I don't want to have to add a "using namespace ..." line to every file that uses one of these types, after all I already have to add a #include for the file.
MyFile.cpp:
#include "typedefs.h"
void Bob()
{
IntList^ list = gcnew IntList;
}
typedefs.h:
namespace Typedefs
{
typedef List<int> IntList;
typedef array<int> IntArray;
typedef List<Byte> ByteList;
typedef array<Byte> ByteArray;
typedef List<String^> StringList;
typedef array<String^> StringArray;
}
using namespace Typedefs;
Would it be acceptable to add the "using namespace" line immediately after the namespace declaration? If not, why not?