what's the problem with my iterator?

M

Magcialking

the following code just won't compile,
.........
vector< vector< vector<int> > >::iterator
it1=fr.begin(),it1_end=fr.end();
for(;it1!=it1_end();it1++){
.........


the message from the compliler is
"36 E:\Dev-Cpp\pp.cpp no match for call to
`(__gnu_cxx::__normal_iterator<std::vector<std::vector<int,
std::allocator<int> >, std::allocator<std::vector<int,
std::allocator<int> > > >*, std::vector<std::vector<std::vector<int,
std::allocator<int> >, std::allocator<std::vector<int,
std::allocator<int> > > >, std::allocator<std::vector<std::vector<int,
std::allocator<int> >, std::allocator<std::vector<int,
std::allocator<int> > > > > > >) ()' "

what's the problem?how to fix it?
 
J

Jim Langston

Magcialking said:
the following code just won't compile,
........
vector< vector< vector<int> > >::iterator
it1=fr.begin(),it1_end=fr.end();
for(;it1!=it1_end();it1++){
........


the message from the compliler is
"36 E:\Dev-Cpp\pp.cpp no match for call to
`(__gnu_cxx::__normal_iterator<std::vector<std::vector<int,
std::allocator<int> >, std::allocator<std::vector<int,
std::allocator<int> > > >*, std::vector<std::vector<std::vector<int,
std::allocator<int> >, std::allocator<std::vector<int,
std::allocator<int> > > >, std::allocator<std::vector<std::vector<int,
std::allocator<int> >, std::allocator<std::vector<int,
std::allocator<int> > > > > > >) ()' "

what's the problem?how to fix it?

How is fr defined?

Is it
std::vector<std::vector<std::vector<int> > > fr; ?
 
M

Magcialking

How is fr defined?

Is it
std::vector<std::vector<std::vector<int> > > fr; ?

it's "vector<vector<vector<int> > >fr;"
with a "using namespace std" declarationn
 
T

Thomas Tutone

Magcialking said:
it's "vector<vector<vector<int> > >fr;"
with a "using namespace std" declarationn

Can you post a small piece of self-contained code that illustrates the
problem? By self-contained, I mean something that we can cut and paste
and compile ourselves. So far, all you have a posted are little
snippets of code, which makes it much harder for us to help you.

By the way, you will often find that in the course of reducing the code
to a small, self-contained piece for you to post, you discover the
problem on your own.

Best regards,

Tom
 
J

Jim Langston

Magcialking said:
the following code just won't compile,
........
vector< vector< vector<int> > >::iterator
it1=fr.begin(),it1_end=fr.end();
for(;it1!=it1_end();it1++){

When I try compiling this I get the problem that you're using it1_end()
instead of it1_end.

If that's your actual code, fix it and try again.
 
T

Thomas Tutone

Jim said:
When I try compiling this I get the problem that you're using it1_end()
instead of it1_end.

If that's your actual code, fix it and try again.

Sharp eyes, Jim!

Best regards,

Tom
 
M

Magcialking

When I try compiling this I get the problem that you're using it1_end()
instead of it1_end.

If that's your actual code, fix it and try again.

gosh,it seems that I really should go and take some sleep, good night
all,and thanks for your help!
Zzz...
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top