• <bdo id='XTXiQ'></bdo><ul id='XTXiQ'></ul>

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

        <tfoot id='XTXiQ'></tfoot>

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

        在 C++ 中使用 Boost 生成 UUID 的示例

        Example of UUID generation using Boost in C++(在 C++ 中使用 Boost 生成 UUID 的示例)
        1. <small id='Exlqt'></small><noframes id='Exlqt'>

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

              <bdo id='Exlqt'></bdo><ul id='Exlqt'></ul>
              • <tfoot id='Exlqt'></tfoot>
                  本文介绍了在 C++ 中使用 Boost 生成 UUID 的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我只想生成随机的 UUID,因为对于我的程序中的实例来说具有唯一标识符非常重要.我查看了 Boost UUID,但我不能设法生成了 UUID,因为我不明白要使用哪个类和方法.

                  I want to generate just random UUID's, as it is just important for instances in my program to have unique identifiers. I looked into Boost UUID, but I can't manage to generate the UUID because I don't understand which class and method to use.

                  如果有人能给我任何如何实现这一目标的例子,我将不胜感激.

                  I would appreciate if someone could give me any example of how to achieve this.

                  推荐答案

                  一个基本的例子:

                  #include <boost/uuid/uuid.hpp>            // uuid class
                  #include <boost/uuid/uuid_generators.hpp> // generators
                  #include <boost/uuid/uuid_io.hpp>         // streaming operators etc.
                  
                  int main() {
                      boost::uuids::uuid uuid = boost::uuids::random_generator()();
                      std::cout << uuid << std::endl;
                  }
                  

                  示例输出:

                  7feb24af-fc38-44de-bc38-04defc3804de

                  7feb24af-fc38-44de-bc38-04defc3804de

                  这篇关于在 C++ 中使用 Boost 生成 UUID 的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)
                  Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)
                  STL BigInt class implementation(STL BigInt 类实现)
                  Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)
                  Move list element to the end in STL(在 STL 中将列表元素移动到末尾)
                  Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)

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

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

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