在 2005 年 1 月的版本中,我们有一些使用 CStdString 类的代码,它是 std::string 的包装器。
此类使用宏 SS_USE_FACET 将函数 std::use_facet 封装为 Microsoft C++ 的特殊实现。对于 Microsoft 编译器,它使用替代宏 _USE。
我们现在收到一个错误,即“_USE 不是 std 的成员”。
如果我在这个宏中注释掉微软的具体情况,它编译得很好。这是宏定义,Microsoft 版本已被注释掉。
#if defined(__SGI_STL_PORT) && (__SGI_STL_PORT >= 0x400 )
#if defined(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS) && defined(_MSC_VER)
#ifdef SS_ANSI
#pragma schMSG(__STL_NO_EXPLICIT_FUNCTION_TMPL_ARGS defined!!)
#endif
#endif
#define SS_USE_FACET(loc, fac) std::use_facet<fac >(loc)
//#elif defined(_MSC_VER )
// #define SS_USE_FACET(loc, fac) std::_USE(loc, fac)
// ...and
#elif defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE)
#define SS_USE_FACET(loc, fac) std::use_facet(loc, (fac*)0)
#else
#define SS_USE_FACET(loc, fac) std::use_facet<fac >(loc)
#endif
这个可以吗?
我是否可以假设微软已经采用了标准实现并最终删除了特殊宏_USE?