首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

入门而困难的有关问题:namespace std到底在哪个文件里定义的

2012-03-09 
入门而困难的问题:namespace std到底在哪个文件里定义的?如题。[解决办法]/* NAMESPACE */#if defined(__cp

入门而困难的问题:namespace std到底在哪个文件里定义的?
如题。

[解决办法]
/* NAMESPACE */

#if defined(__cplusplus)
#define _STD_BEGINnamespace std {
#define _STD_END}
#define _STD::std::

/*
We use the stdext (standard extension) namespace to contain extensions that are not part of the current standard
*/
#define _STDEXT_BEGIN namespace stdext {
#define _STDEXT_END}
#define _STDEXT ::stdext::

#ifdef _STD_USING
#define _C_STD_BEGINnamespace std {/* only if *.c compiled as C++ */
#define _C_STD_END}
#define _CSTD::std::

#else /* _STD_USING */
/* #define _GLOBAL_USING*.h in global namespace, c* imports to std */

#define _C_STD_BEGIN
#define _C_STD_END
#define _CSTD::
#endif /* _STD_USING */

#define _C_LIB_DECLextern "C " {/* C has extern "C " linkage */
#define _END_C_LIB_DECL}
#define _EXTERN_Cextern "C " {
#define _END_EXTERN_C}

#else /* __cplusplus */
#define _STD_BEGIN
#define _STD_END
#define _STD

#define _C_STD_BEGIN
#define _C_STD_END
#define _CSTD

#define _C_LIB_DECL
#define _END_C_LIB_DECL
#define _EXTERN_C
#define _END_EXTERN_C
#endif /* __cplusplus */

热点排行