Ok I'm not seeing how to fix this one.
For homework yes
The non-inline version is defined on line 205.Code:template <typename T> class RubberArray { int indexoffset_; /* other variables and member functions that aren't germane to this problem */ public: /* other member functions that aren't germane to this problem */ void insert ( const T&, int i); // line 28 inline void insert ( int i, const T& a) { insert( (const T&)(a), i); } inline void insert ( const T& v) { insert((const T&)(v), int(indexoffset_) ); } // line 31 };
The error I'm getting is
Now for testing purposes I'm using an RubberArray<int>. I don't see what the problem is with the overloading since it should be able to match the consts up and overload based off of them.rubber.h:31: call of overloaded `insert(const int &, int)' is ambiguous
rubber.h:205: candidates are: void RubberArray<int>::insert(const int &, int)
rubber.h:29: void RubberArray<int>::insert(int, const int &)
I can not use a default parameter to get around this problem since indexoffset_ is not a set value.



LinkBack URL
About LinkBacks



