Is the class iterator part of namespace std now in c++?

X

Xin Wang

I had an earlier version of stl, which is smaller and much more fit to my
needs, the problem is that I found many definitions in it such as
iterator conflict with std namespace.

Is there any way to work around this, or I have to call either one or them
with explicit namespace?

Thanks!


Xin Wang
 
D

David White

Xin Wang said:
I had an earlier version of stl, which is smaller and much more fit to my
needs, the problem is that I found many definitions in it such as
iterator conflict with std namespace.

Does the earlier version place its names in the std namespace?
Is there any way to work around this, or I have to call either one or them
with explicit namespace?

Let me guess. You have:
using namespace std;
in all your source files, or (worse) in your headers. The whole idea of
namespaces is to handle situations exactly like the one you have. You'd be
in a much worse situation without them. Using the explicit qualification
std:: where necessary is one option that would work very well, as long as
only one of your STL versions is in the std namespace. You could also wrap
the earlier version in your own namespace and use explicit qualifications
for that.

DW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
sxarexu

Latest Threads

Top