Hi All,
I have a few classes in a project that I inherited that are really old, last I knew they compiled with CodeWarrior 8. I am now in XCode 3.2
Here is an example of what I struggle with:
template <class registeredObject>
typename std::vector<registeredObject>::iterator FxRegistry<registeredObject>::begin(void)
{
return mRegistryList.begin();
}
The errors are:
no 'typename std::vector<registeredObject, std::allocator<_CharT> >::iterator FxRegistry<registeredObject>::begin()' member function declared in class 'FxRegistry<registeredObject>'
template definition of non-template 'typename std::vector<registeredObject, std::allocator<_CharT> >::iterator FxRegistry<registeredObject>::begin()'
How do I decide how to solve these and where do I start looking?
UPDATE: Here is the FxRegistry Class:
template <class registeredObject>
class FxRegistry
{
public:
// Construction
FxRegistry() {}
~FxRegistry();
// List management
void Register(const registeredObject &ob);
void Unregister(registeredObject &ob);
// List iteration
typedef std::vector<registeredObject>::iterator iterator;
typedef std::vector<registeredObject>::const_iterator const_iterator;
std::vector<registeredObject>::iterator begin(void);
std::vector<registeredObject>::const_iterator begin(void) const;
std::vector<registeredObject>::iterator end(void);
std::vector<registeredObject>::const_iterator end(void) const;
FxSize size(void);
void Insert(iterator iter,const registeredObject &ob);
registeredObject &operator[](FxInt32 index) { return mRegistryList[index]; }
void clear() {mRegistryList.clear();};
protected:
vector<registeredObject> mRegistryList;
};
I get errors on every line above almost that are: error: type 'std::vector >' is not derived from type 'FxRegistry' error: expected ';' before 'iterator'
I thought an iterator was of vector type, so I would declare one vector iterator.