473,320 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

stl vector no match for 'operator=='

Hi I've created a class to be used with stl vector. I'm having a hard time decipher the error message outpout by g++...

Expand|Select|Wrap|Line Numbers
  1. burlen@quaoar:~/hdf52vtk_dev/src$ g++  junk.cpp GridPoint.o
  2. /usr/include/c++/3.3.3/bits/stl_algo.h: In function `_RandomAccessIter
  3.    std::find(_RandomAccessIter, _RandomAccessIter, const _Tp&,
  4.    std::random_access_iterator_tag) [with _RandomAccessIter =
  5.    __gnu_cxx::__normal_iterator<GridPoint*, std::vector<GridPoint,
  6.    std::allocator<GridPoint> > >, _Tp = GridPoint*]':
  7. /usr/include/c++/3.3.3/bits/stl_algo.h:298:   instantiated from `_InputIter std::find(_InputIter, _InputIter, const _Tp&) [with _InputIter = __gnu_cxx::__normal_iterator<GridPoint*, std::vector<GridPoint, std::allocator<GridPoint> > >, _Tp = GridPoint*]'
  8. junk.cpp:47:   instantiated from here
  9. /usr/include/c++/3.3.3/bits/stl_algo.h:208: error: no match for 'operator==' in
  10.    '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
  11.    [with _Iterator = GridPoint*, _Container = std::vector<GridPoint,
  12.    std::allocator<GridPoint> >]() == __val'
  13. GridPoint.h:46: error: candidates are: bool GridPoint::operator==(const
  14.    GridPoint&) const
  15. /usr/include/c++/3.3.3/bits/stl_algo.h:211: error: no match for 'operator==' in
  16.    '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
  17.    [with _Iterator = GridPoint*, _Container = std::vector<GridPoint,
  18.    std::allocator<GridPoint> >]() == __val'
  19. GridPoint.h:46: error: candidates are: bool GridPoint::operator==(const
  20.    GridPoint&) const
  21. /usr/include/c++/3.3.3/bits/stl_algo.h:214: error: no match for 'operator==' in
  22.    '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
  23.    [with _Iterator = GridPoint*, _Container = std::vector<GridPoint,
  24.    std::allocator<GridPoint> >]() == __val'
  25. GridPoint.h:46: error: candidates are: bool GridPoint::operator==(const
  26.    GridPoint&) const
  27. /usr/include/c++/3.3.3/bits/stl_algo.h:217: error: no match for 'operator==' in
  28.    '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
  29.    [with _Iterator = GridPoint*, _Container = std::vector<GridPoint,
  30.    std::allocator<GridPoint> >]() == __val'
  31. GridPoint.h:46: error: candidates are: bool GridPoint::operator==(const
  32.    GridPoint&) const
  33. /usr/include/c++/3.3.3/bits/stl_algo.h:223: error: no match for 'operator==' in
  34.    '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
  35.    [with _Iterator = GridPoint*, _Container = std::vector<GridPoint,
  36.    std::allocator<GridPoint> >]() == __val'
  37. GridPoint.h:46: error: candidates are: bool GridPoint::operator==(const
  38.    GridPoint&) const
  39. /usr/include/c++/3.3.3/bits/stl_algo.h:226: error: no match for 'operator==' in
  40.    '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
  41.    [with _Iterator = GridPoint*, _Container = std::vector<GridPoint,
  42.    std::allocator<GridPoint> >]() == __val'
  43. GridPoint.h:46: error: candidates are: bool GridPoint::operator==(const
  44.    GridPoint&) const
  45. /usr/include/c++/3.3.3/bits/stl_algo.h:229: error: no match for 'operator==' in
  46.    '(&__first)->__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
  47.    [with _Iterator = GridPoint*, _Container = std::vector<GridPoint,
  48.    std::allocator<GridPoint> >]() == __val'
  49. GridPoint.h:46: error: candidates are: bool GridPoint::operator==(const
  50.    GridPoint&)




in my class I have defined it like this:

bool GridPoint::operator== ( const GridPoint &rhs ) const;

can you help me figure what the error messages mean?
Feb 16 '06 #1
0 6107

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

Similar topics

8
by: Giulio | last post by:
I'm doing a class who takes in constructor a vector<int> keeps and makes some statistic on the vector whitout modifiing it. I would like not to make a copy of the vector for the class. to let the...
4
by: Nomak | last post by:
Hello, With this code: $ cat -n ifs.cc 1 #include <vector> 2 #include <iostream> 3 4 using std::vector; 5 using std::cin;
7
by: tehn.yit.chin | last post by:
I am trying to experiment <algorithm>'s find to search for an item in a vector of struct. My bit of test code is shown below. #include <iostream> #include <vector> #include <algorithm>...
7
by: imutate | last post by:
How do I implement << ala std::cout for vector template ? I already have the following: #include <vector> template < typename T > class Vec : public std::vector< T { public: Vec() { } Vec(...
22
by: sandy | last post by:
I am trying to make a simulated directory structure application for a course. I am using a Vector to store pointers to my Directory objects (as subdirectories of the current object). In my...
4
by: lovecreatesbea... | last post by:
The find() in <algorithmrequires two input iterators as its first and second arguments. In some of my code, I use vector<T>::begin() and vector<T>::end() as the first and second arguments. The...
0
by: PaperPilot | last post by:
While trying to copy data into the vector I get the following error messages: stl_algobase.h:247: error: no match for 'operator*' in '*__result' stl_algobase.h:249: error: no match for...
5
by: jeremit0 | last post by:
I'm trying to sort a vector<complex<double and can't figure it out. I recognize the problem is that there isn't a default operator< for complex data types. I have written my own operator and can...
1
by: orangemonkey | last post by:
#include <iostream> #include <math.h> #include <vector> using namespace std; int main (void) { int sv = 0, fv = 0; cout << "Start Value:" << endl;
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.