Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1330884
  • 博文数量: 177
  • 博客积分: 3640
  • 博客等级: 中校
  • 技术积分: 1778
  • 用 户 组: 普通用户
  • 注册时间: 2011-04-27 16:51
文章分类

全部博文(177)

文章存档

2014年(1)

2013年(10)

2012年(3)

2011年(163)

分类: LINUX

2011-05-15 08:09:53

The error new types may not be defined in a return type

can be caused by forgetting a semicolon on the end of the declaration of a class.

错误的写法:

foo.h:

class Foo
{
// stuff
} // missing semicolon

foo.cc:

#include "foo.h"
Foo::Foo(int x) // error shows up in this line
{
// stuff
}


正确的写法:

foo.h:

class Foo
{
// stuff
}; // yay, semicolon!

foo.cc:

#include "foo.h"
Foo::Foo(int x)
{
// stuff
}
阅读(2048) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~