boost :: TypeIndex :: Type_id<>()。pretty_name()不同系统/编译器/boost versions的差异?
我正在尝试运行一个项目,其中 boost :: typeIndex :: type_id<>()。pretty_name()
用于将className转换为字符串,以将其注册在工厂中。
例如,A类应转换为“ A”
,B类TO “ B”
等。
这是通过使用 boost ::的Linux GCC环境中的。 typeIndex :: type_id< a>()。pretty_name()
。
当我尝试使用MSVC 14和Boost 1.78.0在Windows中运行该项目时,类名称以这种方式进行转换:
A类转换为“ A类”“
”,B类将转换为>
>“ B类“
,等等……
这是因为OS差异或编译器差异或某些增强参数或增强版本差异吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
boost's std :: type_info 纯粹是实现dippertiment-depentent的示例,请注意cppreference对应于您的案件。
Boost’s docs state this library is just a wrapper for std::type_info which is purely implementation-dependent, notice how the example on cppreference corresponds to your case.