繁体   English   中英

Microsoft Visual Studio中带有char32_t的std :: regex?

[英]std::regex with char32_t in microsoft visual studio?

好吧,我想知道为什么这不起作用-并且这是否是VS 2010中的简单问题?

std::basic_regex<char32_t> re;

上一行给出了编译错误:

1>c:\program files\microsoft visual studio 10.0\vc\include\regex(1975): error C2027: use of undefined type 'std::tr1::regex_traits<_Elem>'
1>          with
1>          [
1>              _Elem=char32_t
1>          ]

以及很多后续错误,都在同一行中。 因此,这是Visual Studio 2010特有的问题吗?是否有解决方法(除了首先将字符串转换为UTF8并将其用作基础,然后再转换回UTF32)。

和/或我应该使用boost::regex来解决这个问题吗?

您很可能需要在ICU中使用Boost.Regex

示例: icu_example.cpp

或者,如果您使用Windows,则使用MFC: mfc_example.cpp

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM