__gnu_cxx 是在哪些文件定义的。

jsntwjw 2004-09-21 04:24:09
rt.
...全文
975 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
freefalcon 2004-09-22
  • 打赏
  • 举报
回复
那再问一下__gnu_cxx在Boost中有定义吗?
——搜了一下,没有

如果我在VC中编译,遇到__gnu_cxx应该怎么处理啊 ?谢谢啊!
——楼主对名字空间没有概念吗?标准C++中的std怎么用,__gnu_cxx就怎么用
比如using namespace __gnu_cxx;
jsntwjw 2004-09-22
  • 打赏
  • 举报
回复
如果我在VC中编译,遇到__gnu_cxx应该怎么处理啊 ?谢谢啊!
jsntwjw 2004-09-22
  • 打赏
  • 举报
回复
那再问一下__gnu_cxx在Boost中有定义吗?
daylove 2004-09-21
  • 打赏
  • 举报
回复
#ifndef __blue_std_ext_
#define __blue_std_ext_
#include <ext/hash_map>
#include <iostream>
#include <string>
#include <vector>

namespace __gnu_cxx
{
/**
*
*/
template<> struct hash<std::string>
{
size_t operator()(const std::string& s) const;
};
}

namespace std
{
/**
* Overridden "<<" operator. Puts the string returned from
* toString() and a newline onto the stream 's'.
*/
template<class T> std::ostream& operator<<(std::ostream& s, const std::vector<T>& v);
}

#endif /* __blue_std_ext_ */


whyglinux 2004-09-21
  • 打赏
  • 举报
回复 1
__gnu_cxx这是一个名子空间名(namespace)名,在GCC编译器使用的C++库中定义(名子空间的定义与一般变量不同,并不局限于某一文件)。定义这个名子空间的目的有二:一是将一些内部名子(编译器实现相关)与 std 空间隔离,二是为了实现一些公用的GNU扩展。

24,857

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧