Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > common baseclass for stl classes?

Reply
Thread Tools

common baseclass for stl classes?

 
 
andy
Guest
Posts: n/a
 
      03-17-2005
Hy I need a common baseclass for some stl containers (for example
vector<int> and deque<int>.
I cant think of writing one without causing additional memory
consumption (per Object. Memory per class doesnt matter).
Does anyone know a solution?
Is it possible to overwrite a virtual function by inheriting this
function from an already existing class?

Thx, Andy
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      03-17-2005
"andy" <> wrote...
> Hy I need a common baseclass for some stl containers (for example
> vector<int> and deque<int>.


Why?

> I cant think of writing one without causing additional memory
> consumption (per Object. Memory per class doesnt matter).
> Does anyone know a solution?
> Is it possible to overwrite a virtual function by inheriting this
> function from an already existing class?


I am not sure I understand the question. Overwrite? Do you mean
"override"? If so, "override by inheriting"? Those are opposites.
You either inherit or you override.

V


 
Reply With Quote
 
 
 
 
Dietmar Kuehl
Guest
Posts: n/a
 
      03-17-2005
andy wrote:
> Hy I need a common baseclass for some stl containers (for example
> vector<int> and deque<int>.


There is no such thing as a common base class to the standard
library containers. Thus, your need cannot be satisfied. Maybe
we can come up with a solution to your problem if you describe
what problem you want to solve rather than asking for details
about what you envision your solution to look like.
--
<private.php?do=newpm&u=> <http://www.dietmar-kuehl.de/>
<http://www.contendix.com> - Software Development & Consulting

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A deque containing different types of objects (with a common baseclass) Juha Nieminen C++ 16 09-17-2007 03:05 AM
Problem with __str__ if baseclass is list Edward C. Jones Python 1 11-13-2005 08:17 AM
overwriting method in baseclass Harald Massa Python 5 02-09-2005 09:13 PM
Accessing a protected member of a member of type BaseClass???? Steven T. Hatton C++ 2 08-16-2004 03:11 PM
classes: virtual functions from baseclass verbatime C++ 7 03-04-2004 06:53 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57