boost.utility的base_from_member
来源:互联网 发布:控制微信摇骰子软件 编辑:程序博客网 时间:2024/06/06 22:59
// base_from_member.cpp // made by davidsu33// 2014-9-28#include "stdafx.h"#include <boost/utility/base_from_member.hpp>#include <boost/core/addressof.hpp>#include <string>typedef int RGBA;using namespace std;//手class BaseHand{public:BaseHand(RGBA color):m_rgba(color){}virtual ~BaseHand(){}private:RGBA m_rgba;};//脚class BaseFoot{public:BaseFoot(int size, const std::string& style):m_size(size),m_style(style){};virtual ~BaseFoot(){}private:int m_size;std::string m_style;};//头class BaseHead{public:BaseHead(int width, int height): m_width(width),m_height(height){}; virtual ~BaseHead(){}private:int m_width;int m_height;};//NPCclass GameNPC : public BaseHand,public BaseFoot,public BaseHead{public:GameNPC(RGBA rgba, int footsize, const std::string& footstyle,int headWidth, int headHeight):BaseHand(rgba),BaseFoot(footsize, footstyle),BaseHead(headWidth, headHeight){}};//base_from_memberclass BFMGameNPC :public boost::base_from_member<BaseHand>,boost::base_from_member<BaseFoot>,boost::base_from_member<BaseHead>{public:typedef boost::base_from_member<BaseHand> pbase0_type;typedef boost::base_from_member<BaseFoot> pbase1_type;typedef boost::base_from_member<BaseHead> pbase2_type;public:BFMGameNPC();~BFMGameNPC();};BFMGameNPC::BFMGameNPC()//简化多参数的继承:pbase0_type(1002),pbase1_type(2, "pegine"),pbase2_type(100, 200){}BFMGameNPC::~BFMGameNPC(){}int _tmain(int argc, _TCHAR* argv[]){BFMGameNPC bfmnp;GameNPC npc(10002, 2, "pengine", 100, 200);return 0;}
0 0
- boost.utility的base_from_member
- boost::utility
- boost utility
- boost utility
- Boost.Utility.
- Boost::Utility库 之enable_if
- C++“准”标准库Boost学习指南(3):Boost.Utility
- C++下的<utility>
- utility
- 一些有用的c++ utility
- Xrm.Utility.openEntityForm的使用
- 一个整形(Integer)数组(Array)的Utility
- Yahoo! UI Library: Resize Utility的使用
- Oracle Cluster verification utility failed 的解决方法
- 发现ibm packaging utility的魅力
- EOS Utility无法安装的问题解决
- [Unity&]缺少引用空间Utility的解决办法
- 找不到ESRI.ArcGIS.Utility;的引用
- Android应用程序进程启动过程的源代码分析 .
- Paxos历史回顾
- hdu 3648 Median Filter 树状数组+二分查找+优化
- 对M4芯片的CRC模块改造来计算标准CRC32
- 黑马程序员——内存管理
- boost.utility的base_from_member
- Incorrect key file for table ‘/tmp/#sql_bd2_0.MYI’解决
- BroadLeaf项目搜索功能改进
- java对象中必有一个父类对象
- 递归输出vecotr
- Android调节声音的基本步骤
- 理解ThreadLocal
- linux grep命令详解
- JQuery DataTables 列自定义数据类型排序