Passing reference of an object to function gives error

Hello, I am currently trying to pass a reference to an object to a function.
First I get a reference to the vector that stores it
 
  vector <Bbox>& bbox_container = scene->getBboxContainer();


Then I proceed to call the method that has this declaration:

void intersect (Vec3f& camera_dir, Vec3f& camera_ori, Vec3f& dist, Vec3f& s2, Bbox& s, float& v, int x, int y);

and I try to do so with this function call

if (bbox_container[i].intersect (camera_dir,camera_ori,dist_ori[i],s2_ori[i],bbox_container[i],t,x,y))

and this line generates this massive error message:

|249|error: could not convert ‘((Bbox*)((std::vector<Bbox, std::allocator<Bbox> >*)bbox_container)->std::vector<_Tp, _Alloc>::operator[] [with _Tp = Bbox, _Alloc = std::allocator<Bbox>](((long unsigned int)i)))->Bbox::intersect(((Vec3f&)(& camera_dir)), ((Vec3f&)(& camera_ori)), ((Vec3f&)(dist_ori + ((long unsigned int)(((long unsigned int)i) * 12ul)))), ((Vec3f&)(s2_ori + ((long unsigned int)(((long unsigned int)i) * 12ul)))), ((Bbox&)((Bbox*)((std::vector<Bbox, std::allocator<Bbox> >*)bbox_container)->std::vector<_Tp, _Alloc>::operator[] [with _Tp = Bbox, _Alloc = std::allocator<Bbox>](((long unsigned int)i)))), ((float&)(& t)), x, y)’ to ‘bool’|

I honestly do not know what it is trying to tell. All I can tell is that a similar code, where the vector of a certain object is replaced by a dynamic array of it works.

So I will appreciate any suggestions.

Last edited on
Are you sure that's the full error line? You're missing a ' for a start.

It would also help if you posted the definitions of dist_ori and s2_ori.
error: could not convert ‘something’ to ‘bool’

Like in:
1
2
3
void intersect();

if ( intersect() ) // error: how to make bool from void? 
Topic archived. No new replies allowed.