Article View: comp.std.c++
Article #2233Inheriting Enums
From: wslade
Date: Wed, 18 Oct 1995 16:58
Date: Wed, 18 Oct 1995 16:58
36 lines
1739 bytes
1739 bytes
I have been using enums to define error numbers within a specific class.
I now want to derive a class from this base. I would also like to derive
the enum from the base.
For example
class A
{
enum AError
{
eErrorOpen, eErrorClose
}
};
class B : public A
{
enum BError : AError
{
eErrorPipeOpen // Would start at one more than AError::eErrorClose
}
};
Has anyone ever wanted to do this or is there another way of doing
the same thing.
Is this a possibility of being added to the C++ standard.
----------------------------------------------------------------------
Warwick Slade | wslade@atlanta.com
Software Consultant | (wk) +1-770-3938646
Computer Consulting Services Corporation |
----------------------------------------------------------------------
Plus Tax, Plus Tax, Plus Tax, Plus Tax, Plus Tax, Plus Tax, Plus Tax.
----------------------------------------------------------------------
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<199510181645.MAA13614@atlanta.com>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 18 Oct 95 16:58:05 GMT Approved: fjh@cs.mu.oz.au Organization: - Newsgroups: comp.std.c++ Return-Path: <wslade@atlanta.com> X-Original-Date: Wed, 18 Oct 1995 12:45:09 -0400 Message-ID: <199510181645.MAA13614@atlanta.com> From: wslade@atlanta.com Subject: Inheriting Enums X-Mailer: AIR Mail 3.X (SPRY, Inc.) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMIUyROEDnX0m9pzZAQHIkQGAkyk8mp6YOZHsjIsYUieaZ1EQFbzX6nj6 4irJNF6lrWqL6CkO71v6uRlP7Ng2K4at =MLQo