c++ - 将 boost::uuid 转换为 char*

标签 c++ boost uuid

我希望将 boost::uuid 转换为 const char*。转换的正确语法是什么?

最佳答案

以防万一,还有boost::uuids::to_string,其工作原理如下:

#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_io.hpp>

boost::uuids::uuid a = ...;
const std::string tmp = boost::uuids::to_string(a);
const char* value = tmp.c_str();

关于c++ - 将 boost::uuid 转换为 char*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3452272/

相关文章:

C++ 与 new 和范围的混淆

c++ - 它如何清除所有已经排队的已发布任务?

java - UUID 的数据类型作为 JPA 实体类中的主键

c++ - C++中的初始化二维 vector

python - 如何在 C[++] 中实现 __delitem__ 和 __delslice__?

c++ - Boost::Spirit 中的复合语法

c++ - boost 共享内存 : vector of char *

.net - GUID 在可预测性方面的安全性如何?

python - 如何在给定范围内在python中生成UUID

c++ - CMake 无法找到 mysqlclient 库