This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: How to Compile libstdc++ v3 by gcc 2.95.3?
- From: John Love-Jensen <eljay at adobe dot com>
- To: Chih-Wei Chiu <jwchiu at csie dot nctu dot edu dot tw>, <gcc-help at gcc dot gnu dot org>, <libstdc++ at gcc dot gnu dot org>
- Date: Mon, 15 Apr 2002 06:52:32 -0500
- Subject: Re: How to Compile libstdc++ v3 by gcc 2.95.3?
Title: Re: How to Compile libstdc++ v3 by gcc 2.95.3?
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 solution.)
--Eljay
On 4/15/02 6:38 AM, "Chih-Wei Chiu" <jwchiu@csie.nctu.edu.tw> wrote:
Program Listing
===============
#include <stack>
class bar : public std::stack<int> {};
int main( int argc, char* argv[] ) { return 0; }