This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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; }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]