![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
G++
avagrant158
这个作者很懒,什么都没留下…
展开
-
编写跨平台程序的关键,C/C++中的内置宏定义
<br />分两部分:<br />操作系统判定:<br />Windows: WIN32<br />Linux: linux<br />Solaris: __sun<br />编译器判定:<br />VC: _MSC_VER<br />GCC/G++: __GNUC__<br />SunCC: __SUNPRO_C和__SUNPRO_CC原创 2011-04-02 13:54:00 · 1555 阅读 · 0 评论 -
const变量被编译器自动优化为const引用变量,delete危险
T* pb=new T(); const T a=*pb;//a 被编译器优化为const T& a=b; delete pb;//错误原创 2011-08-03 10:12:12 · 250 阅读 · 0 评论 -
there are no arguments to '***' that depend on a template parameter, so a declaration of
linux下会出现如下错误: there are no arguments to '***' that depend on a template parameter, so a declaration of '***' must be available 错误:‘×××’ 的实参不依赖模板参数,所以 ‘×××’ 的声明必须可用 需要在×××之前增加范围标识,参考http://gcc.gn转载 2012-01-17 14:41:07 · 3029 阅读 · 0 评论