473,549 Members | 2,682 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

std::find

Hello,

I have a question. I have the following construct:

std::vector < std::vector < std::vector< AsMarkerMatchMa trix >> >
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


Jul 19 '05 #1
3 14177

"Peter Meier" <pe*********@ ar-solutions.de> wrote in message
news:bl******** **@wsc10.lrz-muenchen.de...
Hello,

I have a question. I have the following construct:

std::vector < std::vector < std::vector< AsMarkerMatchMa trix >> >
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

Jul 19 '05 #2
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
Hello,

I have a question. I have the following construct:

std::vector < std::vector < std::vector< AsMarkerMatchMa trix >> >
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

Jul 19 '05 #3
"Peter Meier" <pe*********@ ar-solutions.de> wrote in message
news:bl******** **@wsc10.lrz-muenchen.de...
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
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
12804
by: zhou | last post by:
Hi there, We have a compiler specific issue which requires us to force template instantiation. This works fine. The problem comes when I try using std:find() on vector. Since vector has no member function find() and I have to use std::find(). The linker fails on unsatisified symbols in find(). I think this is because find() is a template...
3
1807
by: Old Wolf | last post by:
In the documentation for std::find, it says: find returns the first iterator i in the range [first, last) for which the following condition holds: *i == value. However in my compiler's headers the implementation is: template <class InputIterator, class T> InputIterator find (InputIterator first, InputIterator last, const T& value)
1
2199
by: Adam Teasdale Hartshorne | last post by:
I would be extremely grateful if somebody could tell me what as I getting wrong with this little bit of code to find the index of a particular element in a std::vector std::vector<int> allVertices ; getTriangleVertices(t, allVertices) ; //Fills the allVertices vector getTriangleVertices(t, allVertices) ; print("All Vertices",...
18
7176
by: ma740988 | last post by:
Trying to get more acclimated with the use of function objects. As part of my test, consider: # include <vector> # include <iostream> # include <algorithm> #include <stdexcept> #include <bitset> using std::vector;
7
3689
by: Bit byte | last post by:
I have the ff code: list<string> *m_alive_list ; list<string>::iterator my_iter; my_iter = find(m_alive_list->begin(), m_alive_list->end, string(inbox) ; Compiler barfs on 2nd line with this error msg: error C2665: 'std::find' : none of the 3 overloads can convert parameter 1 from type 'std::list<_Ty>::iterator'
8
8622
by: brekehan | last post by:
If I have a class MyClass { ...bunch o data and methods int x; }; and a stl container of MyClass objects Is there a way to use std::find to get all the elements whose member x
4
5519
by: Anonymous | last post by:
I ahve a vector of doubles taht I need to extract values from. I was just about to use the STL find() algo, but I have a couple of questions: first: can you specify the tolerance threshold to match on doubles? second: if yes, how may this be done (i.e. how many one specify the tolerance threshold for comparing doubles?)
0
7957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7809
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.