| 41 | // problem, since the non-const function will not match at all. |
| 42 | |
| 43 | int implicit_cast( |
| 44 | class_rep const* crep |
| 45 | , LUABIND_TYPE_INFO const& type_id |
| 46 | , int& pointer_offset) |
| 47 | { |
| 48 | int offset = 0; |
| 49 | if (LUABIND_TYPE_INFO_EQUAL(crep->type(), type_id)) return 0; |
| 50 | |
| 51 | for (vector_class<class_rep::base_info>::const_iterator i = |
| 52 | crep->bases().begin(); i != crep->bases().end(); ++i) |
| 53 | { |
| 54 | int steps = implicit_cast(i->base, type_id, offset); |
| 55 | pointer_offset = offset + i->pointer_offset; |
| 56 | if (steps >= 0) return steps + 2; |
| 57 | } |
| 58 | pointer_offset = 0; |
| 59 | return -1; |
| 60 | } |
| 61 | }} |
| 62 | |