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

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

        C++ 枚举中的最大值和最小值

        Max and min values in a C++ enum(C++ 枚举中的最大值和最小值)

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

              <tbody id='u5A6G'></tbody>

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

                  <bdo id='u5A6G'></bdo><ul id='u5A6G'></ul>
                  <legend id='u5A6G'><style id='u5A6G'><dir id='u5A6G'><q id='u5A6G'></q></dir></style></legend>
                • 本文介绍了C++ 枚举中的最大值和最小值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有没有办法在 C++ 中找到枚举的最大值和最小值?

                  Is there a way to find the maximum and minimum defined values of an enum in c++?

                  推荐答案

                  不,没有办法在 C++ 中找到任何枚举的最大值和最小值.当需要此类信息时,定义 Last 和 First 值通常是一种很好的做法.例如,

                  No, there is no way to find the maximum and minimum defined values of any enum in C++. When this kind of information is needed, it is often good practice to define a Last and First value. For example,

                  enum MyPretendEnum
                  {
                     Apples,
                     Oranges,
                     Pears,
                     Bananas,
                     First = Apples,
                     Last = Bananas
                  };
                  

                  不需要为 FirstLast 之间的每个值指定命名值.

                  There do not need to be named values for every value between First and Last.

                  这篇关于C++ 枚举中的最大值和最小值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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?)

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

                        <tbody id='zToWd'></tbody>
                      • <bdo id='zToWd'></bdo><ul id='zToWd'></ul>

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