<legend id='uVMHF'><style id='uVMHF'><dir id='uVMHF'><q id='uVMHF'></q></dir></style></legend>
        <bdo id='uVMHF'></bdo><ul id='uVMHF'></ul>
    1. <tfoot id='uVMHF'></tfoot>
      <i id='uVMHF'><tr id='uVMHF'><dt id='uVMHF'><q id='uVMHF'><span id='uVMHF'><b id='uVMHF'><form id='uVMHF'><ins id='uVMHF'></ins><ul id='uVMHF'></ul><sub id='uVMHF'></sub></form><legend id='uVMHF'></legend><bdo id='uVMHF'><pre id='uVMHF'><center id='uVMHF'></center></pre></bdo></b><th id='uVMHF'></th></span></q></dt></tr></i><div id='uVMHF'><tfoot id='uVMHF'></tfoot><dl id='uVMHF'><fieldset id='uVMHF'></fieldset></dl></div>

      <small id='uVMHF'></small><noframes id='uVMHF'>

        基本枚举类继承

        Base enum class inheritance(基本枚举类继承)
            <tbody id='1R4IZ'></tbody>
            <legend id='1R4IZ'><style id='1R4IZ'><dir id='1R4IZ'><q id='1R4IZ'></q></dir></style></legend>
              • <bdo id='1R4IZ'></bdo><ul id='1R4IZ'></ul>
                <tfoot id='1R4IZ'></tfoot>

                  <small id='1R4IZ'></small><noframes id='1R4IZ'>

                1. <i id='1R4IZ'><tr id='1R4IZ'><dt id='1R4IZ'><q id='1R4IZ'><span id='1R4IZ'><b id='1R4IZ'><form id='1R4IZ'><ins id='1R4IZ'></ins><ul id='1R4IZ'></ul><sub id='1R4IZ'></sub></form><legend id='1R4IZ'></legend><bdo id='1R4IZ'><pre id='1R4IZ'><center id='1R4IZ'></center></pre></bdo></b><th id='1R4IZ'></th></span></q></dt></tr></i><div id='1R4IZ'><tfoot id='1R4IZ'></tfoot><dl id='1R4IZ'><fieldset id='1R4IZ'></fieldset></dl></div>

                2. 本文介绍了基本枚举类继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否有一种模式可以让我从 C++ 中的另一个枚举继承枚举??

                  Is there a pattern where I can inherit enum from another enum in C++??

                  类似的东西:

                  enum eBase 
                  {
                     one=1, two, three
                  };
                  
                  
                  enum eDerived: public eBase
                  {
                     four=4, five, six
                  };
                  

                  推荐答案

                  不可能.枚举没有继承.

                  Not possible. There is no inheritance with enums.

                  您可以改为使用具有命名 const int 的类.

                  You can instead use classes with named const ints.

                  示例:

                  class Colors
                  {
                  public:
                    static const int RED = 1;
                    static const int GREEN = 2;
                  };
                  
                  class RGB : public Colors
                  {
                    static const int BLUE = 10;
                  };
                  
                  
                  class FourColors : public Colors
                  {
                  public:
                    static const int ORANGE = 100;
                    static const int PURPLE = 101;
                  };
                  

                  这篇关于基本枚举类继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?(静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么?)
                  How do I load a C DLL from the SXS in Python?(如何从 Python 中的 SXS 加载 C DLL?)
                  Can Cython code be compiled to a dll so C++ application can call it?(Cython 代码可以编译成 dll 以便 C++ 应用程序可以调用它吗?)
                  Delay Loading DLLs(延迟加载 DLL)
                  Throwing C++ exceptions across DLL boundaries(跨 DLL 边界抛出 C++ 异常)
                  Loading a dll from a dll?(从 dll 加载 dll?)
                3. <tfoot id='HtG8Y'></tfoot>
                    <bdo id='HtG8Y'></bdo><ul id='HtG8Y'></ul>

                    <small id='HtG8Y'></small><noframes id='HtG8Y'>

                    1. <i id='HtG8Y'><tr id='HtG8Y'><dt id='HtG8Y'><q id='HtG8Y'><span id='HtG8Y'><b id='HtG8Y'><form id='HtG8Y'><ins id='HtG8Y'></ins><ul id='HtG8Y'></ul><sub id='HtG8Y'></sub></form><legend id='HtG8Y'></legend><bdo id='HtG8Y'><pre id='HtG8Y'><center id='HtG8Y'></center></pre></bdo></b><th id='HtG8Y'></th></span></q></dt></tr></i><div id='HtG8Y'><tfoot id='HtG8Y'></tfoot><dl id='HtG8Y'><fieldset id='HtG8Y'></fieldset></dl></div>

                          <tbody id='HtG8Y'></tbody>

                      1. <legend id='HtG8Y'><style id='HtG8Y'><dir id='HtG8Y'><q id='HtG8Y'></q></dir></style></legend>