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

  • SEARCH
  • Home
  • 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 8664185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:10:56+00:00 2026-06-12T17:10:56+00:00

I am getting an error saying ‘T’ does not name a type. I am

  • 0

I am getting an error saying ‘T’ does not name a type. I am confused as to what this means. I thought i declared it in the class saying Virtual T?

template <class T>
class ABList : public ABCList<T> {
private:
    T    a [LIST_MAX];
    int  size;

public:
         ABList ();

    virtual bool isEmpty ();
    virtual int  getLength ();
    virtual void insert (int pos, T item);
    virtual T    remove (int pos);
    virtual T    retrieve (int pos);
};

.

T  ABList::retrieve (int pos) throw (ListException)
{
    if (pos <= 0 || pos >= count)
        throw new ListException();
    return item[pos – 1];
}
  • 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-06-12T17:10:57+00:00Added an answer on June 12, 2026 at 5:10 pm

    You have to write that as:

    template<typename T>
    T  ABList<T>::retrieve (int pos) throw (ListException)
    {
      //...
    }
    

    because ABList a class template.

    Note that you’ve to define the member functions in the same file itself in which you’ve defined the class template. Defining class template in .h file, and member functions in .cpp would not work in case of templates.

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

Sidebar

Related Questions

We're getting a server error saying Parameter count does not match Parameter Value count.
I'm getting an error saying that the methods are not applicable for the type
I keep getting an error saying that @android:style/Widget.Holo.Light.Button.Borderless is not public and so can't
I am getting a error saying this code needs a parentheses but every time
I am getting error saying: Object reference not set to an instance of an
I keep getting this error saying that it cannot find my javascript function checkpw().
I keep getting an error saying my value is not positioned on a valid
Whats wrong with this query. I'm getting an error saying You have an error
I am getting an error saying the view Update has not been found, I
I keep getting this error saying Syntax error on token }, delete this token.

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.