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 1035419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:32:22+00:00 2026-05-16T14:32:22+00:00

I have code similar to the following in a header file: template<class A> class

  • 0

I have code similar to the following in a header file:

template<class A>
class List {
  private:
    QVector<A> _list;
};

where QVector is the standard QT container.

When I try to make a variable of type List as a member variable in another header file like this:

class Model {
  private:
    List<int *> the_list;
};

I get the following error:

In instantiation of 'List<int *>':
instantiated from here
error: 'List<A>::_list' has incomplete type

Basically, I want a custom list that is templatized that uses an internal QVector to store the data items.

I assume that my syntax is a little off, so any help would be appreciated.

  • 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-16T14:32:23+00:00Added an answer on May 16, 2026 at 2:32 pm

    Make sure you have #included the header file for QVector before your declaration of class List { }. If you omit it then QVector is an undefined type but because List is a templated class the compiler doesn’t omit an error message until you instantiate List for the first time.

    #include <QVector>
    
    template<class A>
    class List {
      private:
        QVector<A> _list;
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a HTML file that has code similar to the following. <table> <tr>
I have code similar to the following in many places: var dbParams = db.ReadParams(memberID,
I have ASP.Net code similar to the following (this is inside a FIELDSET): <ol>
We have similar code to the following in one of our projects. Can anyone
I've got code similar to the following... <p><label>Do you have buffet facilities?</label> <asp:RadioButtonList ID=blnBuffetMealFacilities:chk
I have the following JQuery code which does similar functionality like Stackoverflow where the
I have code similar to this in my application: class A { public: int
I have something like the following in the header class MsgBase { public: unsigned
I have code similar to this filtering entries in an Array of Objects: var
There is probably is simple fix for this but I currently have code similar

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.