common baseclass for stl classes?

A

andy

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
 
V

Victor Bazarov

andy said:
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
 
D

Dietmar Kuehl

andy said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top