现在的位置: 首页 > 综合 > 正文

类的inline函数

2013年12月05日 ⁄ 综合 ⁄ 共 225字 ⁄ 字号 评论关闭

inline关键词在类的函数声明或者定义部分出现一次就可以了,当然出现两次岂不是更加完整吗!

下列代码严重了这点(VC 6.0 WIN XP 32BIT)

#include <iostream>
using namespace std;

class Test
{
public:
	Test(){}
	~Test(){}

	 void show();
};

inline void Test::show()
{
	cout << "this is show function. " << endl;
}

void main()
{
}

抱歉!评论已关闭.