Re: Inheriting from STL bitset
From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 11/05/04
- Next message: E. Robert Tisdale: "Re: Snipe hunting in C++"
- Previous message: P.J. Plauger: "Re: Inheriting from STL bitset"
- In reply to: shaun roe: "Inheriting from STL bitset"
- Next in thread: Ivan Vecerina: "Re: Inheriting from STL bitset"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 05 Nov 2004 16:53:46 -0500
shaun roe wrote:
> I want something which is very like a bitset<64> but with a couple of
> extra functions: set/get the two 32 bit words, and conversion to
> unsigned long long.
There is no unsigned long long in C++. You must be talking about some
compiler extension you're using.
> I can do this easily by inheriting from bitset<64>, but I know that STL
> has no virtual destructor. Can I get around this by calling the
> baseclass destructor explicitly in my derived class?
You don't need to. Virtual destructor is needed when you delete an object
of derived class using a base class pointer. If you're not going to use
dynamic memory allocation, the destructor of the derived class _will_ call
the destructor of the base class.
> Is there another way to get all of the bitset<64> functionality without
> rewriting a lot of code?
Do your inheriting thing and see how it goes.
V
- Next message: E. Robert Tisdale: "Re: Snipe hunting in C++"
- Previous message: P.J. Plauger: "Re: Inheriting from STL bitset"
- In reply to: shaun roe: "Inheriting from STL bitset"
- Next in thread: Ivan Vecerina: "Re: Inheriting from STL bitset"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|