Enum “Inheritance”

后端 未结 15 1498
野性不改
野性不改 2020-11-22 07:21

I have an enum in a low level namespace. I\'d like to provide a class or enum in a mid level namespace that \"inherits\" the low level enum.

namespace low
{
         


        
15条回答
  •  逝去的感伤
    2020-11-22 07:57

    Enums cannot be derrived from other enums, but only from int, uint, short, ushort, long, ulong, byte and sbyte.

    Like Pascal said, you can use other enum's values or constants to initialize an enum value, but that's about it.

提交回复
热议问题