Difficulty in getting iterator upon using find algorithm of STL

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SanjayMK70
    New Member
    • Feb 2016
    • 3

    Difficulty in getting iterator upon using find algorithm of STL

    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.
  • SanjayMK70
    New Member
    • Feb 2016
    • 3

    #2
    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.

    Comment

    • AceInfinity
      New Member
      • Apr 2013
      • 12

      #3
      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.

      Comment

      • SanjayMK70
        New Member
        • Feb 2016
        • 3

        #4
        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.

        Comment

        Working...