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

怎么在.h文件中使用前置申明,本人想使用std:string前置申明,删除#include<string>

2012-06-15 
如何在.h文件中使用前置申明,本人想使用std::string前置申明,删除#includestring#ifndef ROBOT_ROBOT_H_

如何在.h文件中使用前置申明,本人想使用std::string前置申明,删除#include<string>
#ifndef ROBOT_ROBOT_H_
#define ROBOT_ROBOT_H_

#include <string>

#define _ROBOT_BEGIN_ namespace robot_namespace {
#define _ROBOT_END_ }

_ROBOT_BEGIN_

class robot
{
public:
robot();
virtual ~robot();
int run(const std::string &_command);
};

_ROBOT_END_

#endif

[解决办法]
string是个typedef,不是class
[解决办法]

探讨

string是个typedef,不是class

热点排行