<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++ 枚举中的最大值和最小值

        时间:2023-08-26

        <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++ 枚举中的最大值和最小值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:检测多个枚举项何时映射到相同的值 下一篇:c ++如何在不同的枚举名称中使用相同的枚举成员名称而不会出错:重新定义;以前的定义是“枚举器"

                  相关文章

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

                    • <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>