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

    <legend id='OA95W'><style id='OA95W'><dir id='OA95W'><q id='OA95W'></q></dir></style></legend>

    <tfoot id='OA95W'></tfoot>

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

        <bdo id='OA95W'></bdo><ul id='OA95W'></ul>
      1. 如何检查元素是否在 std::set 中?

        时间:2024-05-11

          • <legend id='EdeMH'><style id='EdeMH'><dir id='EdeMH'><q id='EdeMH'></q></dir></style></legend>

              <tbody id='EdeMH'></tbody>

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

                • <small id='EdeMH'></small><noframes id='EdeMH'>

                  本文介绍了如何检查元素是否在 std::set 中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何检查元素是否在集合中?

                  How do you check that an element is in a set?

                  是否有更简单的等价于以下代码:

                  Is there a simpler equivalent of the following code:

                  myset.find(x) != myset.end()
                  

                  推荐答案

                  在许多 STL 容器(例如 std::mapstd::set<)中检查是否存在的典型方法/code>, ... 是:

                  The typical way to check for existence in many STL containers such as std::map, std::set, ... is:

                  const bool is_in = container.find(element) != container.end();
                  

                  这篇关于如何检查元素是否在 std::set 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  <tfoot id='TaGkB'></tfoot>
                  <legend id='TaGkB'><style id='TaGkB'><dir id='TaGkB'><q id='TaGkB'></q></dir></style></legend>

                      <tbody id='TaGkB'></tbody>

                          <bdo id='TaGkB'></bdo><ul id='TaGkB'></ul>