name conflicts

Hi All...

I tried recently to use the STL, and also the templated serial library, but since both implement stream IO, and re in the same namespace, there were conflicts. I was in a hurry, so I gave up and hand coded a solution I had planned to use a Vector for.

But, I am wondering, can this conflict be resolved?

But, I am wondering, can this conflict be resolved?

Easily.

using namespace::std; is to be avoided.

Only use the stuff you actually use.

Specifically, what is/was your problem? With what code?

I'm inclined to agree with PaulS. Namespaces were designed to solve that exact problem. That is, different designers might choose to use the same names. So instead of "using namespace" just be explicit, eg.

#include <iterator>
#include <vector>

typedef std::vector<int> myIntArray;

myIntArray foo (42);

void setup () {
  foo [20] = 32;
}

void loop () {}

In that example, you only have to use "std::" once.

Well the libraries were fat16lib's templatized seria lib and Andy's STL implementation.

The problem came when including them. Both libs implemented stream io in namespace std, but I think I see your point. If i on't specify the namespace with using I can explicitly invoke the vector. I think I tried that, but I'll try again now that I have a little time to play with it.

Thanks guys...