remove_all_pointer
来源:互联网 发布:java 线程超时 编辑:程序博客网 时间:2024/04/29 13:25
boost 提供了 remove_pointer ,不过不够,有的时候我们需要拿掉一个“指向指针的指针……的指针”类型上面所有的“指针”前缀,所以下面这个 remove_all_pointer 就有用了,当然它还很不完善,这里先备份,慢慢修改:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
using namespace boost;
template
struct remove_all_pointer
{
typedef T type;
};
template
struct remove_all_pointer
{
typedef typename remove_all_pointer::type type;
};
看来是非常容易,测试呢:
#include
#include
#include "remove_all_pointer.hpp"
int main()
{
typedef remove_all_pointer::type result;
cout << typeid(result).name() << endl;
typedef remove_pointer::type res1;
cout << typeid(res1).name() << endl;
cin.get();
}
结果不用我说了。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
using namespace boost;
template
struct remove_all_pointer
{
typedef T type;
};
template
struct remove_all_pointer
{
typedef typename remove_all_pointer
};
看来是非常容易,测试呢:
#include
#include
#include "remove_all_pointer.hpp"
int main()
{
typedef remove_all_pointer
cout << typeid(result).name() << endl;
typedef remove_pointer
cout << typeid(res1).name() << endl;
cin.get();
}
结果不用我说了。
- remove_all_pointer
- remove_all_pointer
- remove_all_pointer
- remove_all_pointer
- remove_all_pointer
- Inside ObjectBuilder Part 4
- Inside ObjectBuilder Part 3
- Inside ObjectBuilder Part 2
- Inside ObjectBuilder Part1
- LINQ
- Lotus Cars
- I Love IIS7
- .Net vs Windows铪铪铪铪铪铪
- .Net Remoting Architecture
- web Service
- Socket Programming with VB
- XML and Databases铪
- DNN - skin quick reference
- YC++创建HTML工具栏
- 高血压,吃什么好,如何治疗
- 软件思考系列之一
- WINX的消息分派机制(续)
- 如何迁移数据库到另一个分区
- remove_all_pointer
- 如何在NTFS文件系统中创建文件的Link
- 测试观念谈
- 更关注Google输入法发布对搜索的意义[有下载链接]
- 企业管理器中设置权限时, 勾、叉和什么都不选,在权限控制上有什么区别?
- 如何构造一个元素类型为Struct的SafeArray
- 高血压,注意什么,预防
- WINX的消息分派机制
- Windows Vista真的只是加了新界面吗?