Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 719507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:39:01+00:00 2026-05-14T05:39:01+00:00

I have a few classes in a project that I inherited that are really

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:39:01+00:00Added an answer on May 14, 2026 at 5:39 am
    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;
    

    In all those places you should be using:

    typename std::vector<registeredObject>::iterator
    

    iterator and const_iterator are dependent names (their meaning depends on what a particular instantiation of vector<X> might turn out to contain), and the language requires that you tell whether it is a type name or not, so the compiler can know without instantiating vector<X>.

    Also it might make sense to use the typedefs you define.

    As to what to start from – the first error on the list. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few classes that perform background tasks that might raise exceptions. They
With a PHP MVC project, I have a few model classes that load data
I have a few classes in a project that should be created only once.
I have a few classes in my current project where validation of Email/Website addresses
i have a few classes that i am trying to move to using generics
I have a few classes, such as those that outline database table structure or
I have a few classes such that: public class XMLStatusMessage extends XMLMessage {} public
I have a few classes which have a property which is unique to that
We currently have quite a few classes in a project, and each of those
I have a bunch of classes in a CUDA project that are mostly glorified

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.