在boost 1.48.0版本的正则表达式代码(boost/regex/v4/w32_regex_traits.hpp)中,我找到了以下内容:
w32_regex_traits()
: m_pimpl(re_detail::create_w32_regex_traits<charT>(::boost::re_detail::w32_get_default_locale()))
{ }
//...//
BOOST_REGEX_DECL lcid_type BOOST_REGEX_CALL w32_get_default_locale()
{
return ::GetUserDefaultLCID();
}
我需要覆盖w32_get_default_locale()函数,因为我希望始终设置美国区域设置。如何在不修改源代码的情况下完成此操作?
BOOST_REGEX_USE_CPP_LOCALE
? - l33tBOOST_REGEX_NO_W32
,这似乎更适用于您的具体问题。 - ildjarnimbue
在basic_regex
对象上设置其区域设置为其他LCID
(如果您愿意). - Anonymous