如何在编译时从字符串生成boost uuid

发布于 2024-08-25 23:24:47 字数 76 浏览 6 评论 0原文

有没有办法在编译时从 988A00C4-79F3-46f9-98CD-D5AD4AA2A0FE 这样的字符串生成 boost uuid ?

is there a way to generate a boost uuid from a string like 988A00C4-79F3-46f9-98CD-D5AD4AA2A0FE at compile time?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

陌路终见情 2024-09-01 23:24:47

不,因为在 C++ 中编译时没有对字符串文字进行处理。

根据您的需要以及从何处获取字符串,您可以使用预构建步骤,将其直接放入某种聚合初始值设定项形式或可以在编译时处理的内容(即编译时字符列表)。

No, because there is no processing of string literals at compile time in C++.

Depending on what you need and where you get the string from, you could use a pre-build-step that directly puts it into some aggregate initializer form or something that you can process at compile time (i.e. compile-time lists of characters).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文