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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:57:07+00:00 2026-06-13T18:57:07+00:00

I’m trying to declare a list of lists in this way: List_vector<List_vector<int> > multilist;

  • 0

I’m trying to declare a list of lists in this way:

List_vector<List_vector<int> > multilist;

But Eclipse underlines the above declaration and gives this error:

required from here

Partial List_vector implementation:

template<class T>
class List_vector: public Linear_list<T, int> {
public:
  typedef typename Linear_list<T, int>::value_type value_type;
  typedef typename Linear_list<T, int>::position position;

  List_vector();
  List_vector(int);
  List_vector(const List_vector<T>&);
  ~List_vector();
private:
    void change_dimension_(T*&, int, int);
    value_type* elements_;
    int length_; // the length of the list
    int array_dimension_; // array's dimension
};

Compiler output:

g++ -O3 -Wall -c -fmessage-length=0 -o multilista.o "..\\multilista.cpp" 
In file included from ..\multilista.cpp:1:0:
..\list_vector.h: In instantiation of 'List_vector<T>::~List_vector() [with T = List_vector<int>]':
..\multilista.cpp:16:32: required from here
..\list_vector.h:78:5: warning: deleting object of polymorphic class type List_vector<int>' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
..\list_vector.h: In member function 'List_vector<T>::value_type List_vector<T>::read(List_vector<T>::position) const [with T = int; List_vector<T>::value_type = int; List_vector<T>::position = int]':
..\list_vector.h:136:1: warning: control reaches end of non-void function [-Wreturn-type]
..\list_vector.h: In member function 'List_vector<T>::value_type List_vector<T>::read(List_vector<T>::position) const [with T = List_vector<int>; List_vector<T>::value_type = List_vector<int>; List_vector<T>::position = int]':
..\list_vector.h:136:1: warning: control reaches end of non-void function [-Wreturn-type]
g++ -O3 -Wall -c -fmessage-length=0 -o tester.o "..\\tester.cpp" 
g++ -o Lista.exe tester.o multilista.o 
  • 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-13T18:57:09+00:00Added an answer on June 13, 2026 at 6:57 pm
    In file included from ..\multilista.cpp:1:0:
    ..\list_vector.h: In instantiation of 'List_vector<T>::~List_vector() [with T = List_vector<int>]':
    ..\multilista.cpp:16:32:   required from here
    ..\list_vector.h:78:5: warning: deleting object of polymorphic class type 'List_vector<int>' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
    

    If you’re going to derive from Linear_List, you should consider making the destructor virtual, like it says. This is only a warning though, and only you know whether it is really required (there isn’t enough code pasted to judge).

    ..\list_vector.h: In member function 'List_vector<T>::value_type List_vector<T>::read(List_vector<T>::position) const [with T = int; List_vector<T>::value_type = int; List_vector<T>::position = int]':
    ..\list_vector.h:136:1: warning: control reaches end of non-void function [-Wreturn-type]
    

    You haven’t pasted the code for List_vector::read, but it seems to be doing something wrong: every path out of the function should return a List_vector::value_type (unless it throws an exception), but you’re letting control reach the end without doing either.

    ..\list_vector.h: In member function 'List_vector<T>::value_type List_vector<T>::read(List_vector<T>::position) const [with T = List_vector<int>; List_vector<T>::value_type = List_vector<int>; List_vector<T>::position = int]':
    ..\list_vector.h:136:1: warning: control reaches end of non-void function [-Wreturn-type]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:

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.