common baseclass for stl classes?

Discussion in 'C++' started by andy, Mar 17, 2005.

  1. andy

    andy Guest

    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
    andy, Mar 17, 2005
    #1
    1. Advertising

  2. "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
    Victor Bazarov, Mar 17, 2005
    #2
    1. Advertising

  3. 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.
    --
    <mailto:> <http://www.dietmar-kuehl.de/>
    <http://www.contendix.com> - Software Development & Consulting
    Dietmar Kuehl, Mar 17, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. verbatime
    Replies:
    7
    Views:
    338
    John Harrison
    Mar 4, 2004
  2. Steven T. Hatton
    Replies:
    2
    Views:
    399
    tom_usenet
    Aug 16, 2004
  3. Harald Massa

    overwriting method in baseclass

    Harald Massa, Feb 7, 2005, in forum: Python
    Replies:
    5
    Views:
    317
    Harald Massa
    Feb 9, 2005
  4. Edward C. Jones

    Problem with __str__ if baseclass is list

    Edward C. Jones, Nov 12, 2005, in forum: Python
    Replies:
    1
    Views:
    291
    Serge Orlov
    Nov 13, 2005
  5. Juha Nieminen
    Replies:
    16
    Views:
    514
    Kai-Uwe Bux
    Sep 17, 2007
Loading...

Share This Page