I have a function:
Code:
list<Coord>::iterator partition(list<Coord>& mList, list<Coord>::iterator it){
double x = it->get_x();
double y = it->get_y();
double dist = distance(x,y)/3;
return it;
}
I'm getting this error when it reaches the call to the distance function:
Code:
/usr/include/c++/4.1.3/bits/stl_iterator_base_types.h: In instantiation of 'std::iterator_traits<double>’:
main3.cpp:205: instantiated from here
/usr/include/c++/4.1.3/bits/stl_iterator_base_types.h:129: error: ‘double’ is not a class, struct, or union type
but if I just replace the function call with the distance formula itself, it works.
any ideas??