boost
文章平均质量分 92
12345678891234
这个作者很懒,什么都没留下…
展开
-
boost静态断言
使用boost静态断言可以在编译的时候发现断言失败的问题#include templatevoid fun(){ BOOST_STATIC_ASSERT(i>1 && i<10);}int main(){ fun(); fun(); return 1; } 这是断言函数的参数范围 当然也可以断言模板实例化的类型原创 2009-01-17 21:55:00 · 978 阅读 · 1 评论 -
一个头文件
感觉周末写的序列化有点笨 我改良了下 如下: :) /* 核动力机器人 hi.csdn.net/ccsdu2004*///2009.05.17//档案头文件#ifndef G_ARCHIVE_HPP#define G_ARCHIVE_HPP //使用 boost序列化对象 #include #include #in原创 2009-05-18 23:39:00 · 460 阅读 · 0 评论 -
游戏人工智能片段
#ifndef G_AI_STATEMACHINE_HPP#define G_AI_STATEMACHINE_HPP#include #include "State.hpp"using namespace boost;namespace g{ namespace ai { template class Stat原创 2009-03-27 21:14:00 · 658 阅读 · 0 评论 -
编程中的一个疑惑
如下:void AudioManager::LoadFiles() { for(vector::iterator itr = files.begin();itr!=files.end();++itr) { string name = *itr;原创 2009-03-24 22:26:00 · 527 阅读 · 0 评论 -
tinyxml的使用例子
今天使用dev c++编程 下载了tinyxml试试,感觉不错 就留下了一段代码如下:#include #include #include #include #include class RandGen{public: RandGen(); RandGen(unsigned long seedVal);public: void原创 2009-03-08 22:43:00 · 1306 阅读 · 1 评论 -
boost之插槽
进一步学习boost了 代码如下:/* ccsdu2004@yahoo.com.cn www.gaimo.net 08.03.2009 */#include #include //#include #include using namespace std; struct plus_slot{ void o原创 2009-03-08 21:16:00 · 685 阅读 · 0 评论 -
boost之function的简单使用
/* 03.08.2009 ccsdu2004@yahoo.com.cn www.gaimo.net*/#include #include "boost/function.hpp" using namespace std;using namespace boost; class keeping_state{原创 2009-03-07 12:04:00 · 579 阅读 · 1 评论 -
boost之function的简单使用
开始学习和使用boost的function了/* 03.08.2009 ccsdu2004@yahoo.com.cn www.gaimo.net*/#include #include #include using namespace std;using namespace boost;inline bool fun(int a,原创 2009-03-07 11:27:00 · 585 阅读 · 0 评论 -
刚写的游戏音频管理器
代码如下:未完待续 /* 02.22.2009 ccsdu2004@yahoo.com.cn www.gaimo.net this file */#include #include #include #include using namespace std;using namespace boost;using nam原创 2009-02-22 22:35:00 · 1043 阅读 · 0 评论 -
boost的operators
/* ccsdu2004@yahoo.com.cn www.gaimo.net 02.15.2009*///dev c++//boost operators. #include #include #include using namespace std;using namespace boost; //less_tahn_compa原创 2009-02-15 14:33:00 · 539 阅读 · 0 评论 -
boost多位数组
说明问题的例子最好越短越好如下:/* ccsdu2004@yahoo.com.cn www.gaimo.net 02.15.2009*///dev c++//boost多位数组 #include #include #include using namespace std;using namespace boost; cons原创 2009-02-15 14:09:00 · 482 阅读 · 0 评论 -
自行设计的管理器
/* 02.15.2009 ccsdu2004@yahoo.com.cn www.gaimo.net*/#ifndef G_MANGER_RESMANGER_HPP#define G_MANGER_RESMANGER_HPP #include #include #include using namespace std;usi原创 2009-02-15 21:08:00 · 512 阅读 · 0 评论 -
boost bgl dijkstra算法
#include #include #include #include #include #include #include using namespace boost;//链接表typedef adjacency_list > graph_t;//点typedef graph_traits ::vertex_descriptor v原创 2009-02-08 14:47:00 · 3581 阅读 · 0 评论 -
boost学习之function
先发下超越Boost库中的一个代码#include #include "boost/function.hpp"bool some_func(int i ,double d){ return i>d;}int main(){ boost::function f; f=&some_func; std::cout<<f(1,2.0)<<std::原创 2009-01-17 22:32:00 · 525 阅读 · 0 评论 -
使用boost容器指针
使用boost容器指针可以来简化操作,有效避免内存泄漏 头文件boost/ptr_container/ptr_container.hpp命名空间 boost 例子: class Obj{public: virtual void Call() = 0;};class O1: public Obj;class O2:public Obj;原创 2009-06-25 21:01:00 · 828 阅读 · 0 评论