How to Compile libstdc++ v3 by gcc 2.95.3?

John Love-Jensen
Mon Apr 15 04:52:00 GMT 2002

Hi Chih-Wei,

Not that this will help with your compile issue, but...

You shouldn't inherit from the STL classes.  Notice that std::stack<> does
not have a virtual destructor -- a big red flag saying "don't (publically)
inherit from me!"

Use containment (i.e., member variable).  Or, if you really have to,
private/protected inheritance.

(Yet another scenario where "explicit typedef" would be an effective


On 4/15/02 6:38 AM, "Chih-Wei Chiu" <> wrote:

> Program Listing
> ===============
> #include <stack>
> class bar : public std::stack<int> {};
> int main( int argc, char* argv[] ) { return 0; }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libstdc++ mailing list