By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Difficulty in getting iterator upon using find algorithm of STL

P: 3
Hello,
Mine is a project in Visual C++, in which I am using STL, and trying to use the "find" algorithm with vectors. But it's giving me the error, error C2678: binary '==' : no operator found which takes a left-hand operand of type 'xyz' (or there is no acceptable conversion), because I have a class which has a structure 'xyz' whose only member is a BYTE array. Hence a problem. Please help.
Feb 25 '16 #1
Share this Question
Share on Google+
3 Replies


P: 3
Then, how to use the find algorithm from the boost library for a user-defined data type?
Please help.
Thanks in advance. This is urgent.
Feb 26 '16 #2

P: 12
It is not a "find" algorithm, it's a template function in the STL assuming you're talking about the <algorithm> header. Additionally, if this was urgent why didn't you provide some code to help us out? There's no context that would allow us to help you with your issue. The operands don't match and that's about as much as we can tell you.
Feb 28 '16 #3

P: 3
Hello AceInfinity,
Thanks for your reply. I got the answer to my above question, now my new question is as follows:
I have one more difficulty, may be a strange experience. The find function of STL is not giving the iterator position, even if the item to be searched is located in the BYTE array. Does it have anything to do with the size of the arrays as well? because one BYTE array is of 16 bytes, and the one it is to be compared with is of 33 bytes? In such a case, how can I make the find function give me the correct answer? Please help.
Thanks in advance.
Mar 8 '16 #4

Post your reply

Sign in to post your reply or Sign up for a free account.