std::find

P

Peter Meier

Hello,

I have a question. I have the following construct:

std::vector < std::vector < std::vector< AsMarkerMatchMatrix >> >
m_matchMatrices;

If I run a std::find on that I sometimes get the iterator to be some strange
number like -124224256, although I know there should not be a match. Usually
the iterator points to NULL, if there is no match.

Anybody experienced the problem? MS c++ 7.1

Also I get an "could not deduce template argument" error, if I do not
implement the == operator, although the parent class implements it.

Greetings, Peter
 
M

Mike Wahler

Peter Meier said:
Hello,

I have a question. I have the following construct:

std::vector < std::vector < std::vector< AsMarkerMatchMatrix >> >
m_matchMatrices;

If I run a std::find on that I sometimes get the iterator to be some strange
number like -124224256, although I know there should not be a match. Usually
the iterator points to NULL, if there is no match.

Show us a small compilable example that gives the
problem behavior.
Anybody experienced the problem? MS c++ 7.1

Also I get an "could not deduce template argument" error, if I do not
implement the == operator, although the parent class implements it.

Show a small example that gives this error.

My crystal ball rolled down the driveway and got hit by a car.

-Mike
 
P

Peter Meier

Found the problem: I should compare with vector.end() to find out, if there
was a match, but for the second question I did not find an answer.

Greetings, Peter
 
M

Mike Wahler

Peter Meier said:
Found the problem: I should compare with vector.end() to find out, if there
was a match, but for the second question I did not find an answer.

Please don't top-post.

We cannot answer your question until you provide
context (code).

-Mike
 

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,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top