Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » Adding subclass objects to base class array using AppendPick()
icon5.gif  Adding subclass objects to base class array using AppendPick() [message #9315] Thu, 26 April 2007 17:01 Go to previous message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
I have 1 base class and 3 subclasses. I want to build an array with all of the classes in it and then sort the array on a given variable. I have the operator< defined so I can call sort on the final array, but I am getting an error when trying to call AppendPick() to add all the objects of a subclass to the base class array. Basically, I created an array of the base class, filled it with one subclass type (subclass A) and then tried to append an array of another subclass (subclass B) to it.

My error says:
'void Upp:Array<T>::Append(const Upp:Array<T> &)' : cannot convert parameter 1 from 'ClassAList' to 'const Upp::Array<T> &'

Also, ClassAList is a typedef of Array<ClassA>
--> "typedef Array<ClassA> ClassAList;"

How can I make this work correctly?

Any help is much appreciated.

[Updated on: Thu, 26 April 2007 17:03]

Report message to a moderator

 
Read Message icon5.gif
Read Message
Previous Topic: IsUpper bug?
Next Topic: i18n
Goto Forum:
  


Current Time: Tue May 14 15:43:50 CEST 2024

Total time taken to generate the page: 0.02471 seconds