- 博客(16)
- 收藏
- 关注
原创 Learning Spirit 2
Learning Spirit 2Phase level vs. character levelparse函数有4种形式的重载。template typename IteratorT, typename DerivedT> parse_infoIteratorT> parse ( IteratorT const& first, Itera
2005-03-24 20:56:00
7610
2
原创 Learning Spirit 1
Learning Spirit 1spirit是boost中的语法分析框架。使用spirit可以用来编写语法分析程序。spirit有如下特点:l 使用递归下降分析程序(分析的效率不高)l 模板元编程技术实现(编译慢,但是提高了程序的运行速度)l EBNF语法表示(使用方便直观) Hello, Spirit!下面我们就通过一个简单的例子,来看看spir
2005-03-23 19:01:00
7853
1
原创 要考试了,learning boost系列文章暂停更新
等到考试结束后在说吧!希望大家多多支持阿。我写这些文章的原因有两个。一是作为自己学习boost的笔记。二是因为网上boost的中文资料比较少,为boost中文做点贡献。不知道写的怎么样,希望大家多提点意见。其实,我写的每一篇文章风格都不一样,大家喜欢哪一篇呢?
2005-03-03 19:47:00
6376
2
原创 Learning boost 3 -- string algorithm 1
Learning boost 3string algorithm 1简介string algorithm是boost中提供字符串算法的类库。在这里,字符串不一定是std::basic_string,也可以是其它的stl容器或是c++中的零结尾字符串char*。例:std::string str("Hello");std::vector vstr(str.begin(),
2005-02-22 12:41:00
8832
2
翻译 Learning boost sp 2 -- regex语法规范(翻译)
Learning boost sp 2regex语法规范(翻译) 这部分包含了boost.regex库的正则表达式的语法。这是一份程序员指南,实际的语法由在程序中的正则表达式的选项决定。(译注:即regex类构造函数的flag参数。) 文字(Literals)除了一下字符,其它的任何字符都表示其字面意义(literal)。“.”, “|”, “*”, “?”, “+”,
2005-02-15 00:13:00
9173
原创 Learning boost 7--regex 2
Learning boost 7regex 2在上一篇的learning boost 中,我们已经说完了regex中的三个模板类,这一篇我们要来使用这些类。我们通过三个算法来使用正则式,regex_match、regex_search、regex_replace。regex_matchregex_match算法用来测试一个字符串是否完全匹配正则式。让我们来看一下regex_matc
2005-02-07 15:46:00
7385
翻译 GFX with SDL Lesson 1: Getting started with SDL(翻译)
GFX with SDLLesson 1: Getting started with SDL作者:Marius Andra翻译:heroboy欢迎来到“GFX with SDL”的第一篇教程。在Dev-C++中使用SDL首先需要下载sdlDevCPP-1.2.4.zip(点击名称下载)。把zip文件解压到Dev C++的目录中,请确定include和lib文件夹(zip文件中)中的文件解压到D
2005-02-05 20:35:00
9738
原创 Learning boost 6--Regex 1
Learning boost 6Regex 1概述模板类:l basic_regex 用来保存一个“正则表达式”的类。l sub_match 继承于pair迭代器组,用来表示匹配的一个结果。l match_results sub_match的容器,用来表示一次搜索
2005-02-05 20:20:00
16364
1
原创 Learning boost SP 1 -- 什么是complete type
在学习boost的过程中,我们发现在boost的文档中,多处提及了complete type和incomplete type。到底什么是complete type呢?经过我查找msdn,终于发现了,原来complete type是编译器能够确定类型大小的类型,incomplete type是编译器不能确定类型大小的类型。incomplete type有:没有确定成员的struct没有确
2005-02-03 09:38:00
6833
1
原创 Learning boost 5 -- Smart ptr
Learning boost 5Smart ptrBoost中提供的5类智能指针。分别是:l scoped_ptr 独占的指针l scoped_array 独占的数组l shared_ptr 引用计数指针l shared_array
2005-01-27 02:00:00
9310
原创 Learning boost 4 Tuple and ref
Learning boost 4Tuple and refTupleBoost::tuple是类似于std::pair的一个类。Pair有且只能有两个成员(first和second),而tuple的元素可以是0-10个。使用tuple要包含boost/tuple/tuple.hpp文件。例如:#include...tuple t1(1,2.0,”Hello”);
2005-01-23 00:17:00
7238
1
原创 Learning boost 2 Array
Learning boost 2Array简介boost::array是一个对c++数组的包装类。和stl::vector不同的是array和c++数组一样是一个静态大小的容器。请看下面的一个例子:#include #include using namespace std; int main() { boost::array a={1,2,3,4,5
2005-01-10 19:12:00
8651
2
原创 Learning boost 1 Serialization
Learning boost (1)Serialization简单的开始Serialization的中文解释是“串行化” 、“序列化”或者“持久化” ,就是将内存中的对象保存到磁盘中,等到程序再次运行的时候再读取磁盘中的文件恢复原来的对象。下面来看一个简单的例子:#include #include #include #include class A{pr
2005-01-10 19:10:00
10278
1
原创 在Windows程序中,开启控制台
#pragma oncetemplateint k> class _Int2Type{enum{_A=k};}; template bool e1,bool e2> class _enable{public: static void enable() { es(_Int2Type());
2004-09-17 22:02:00
6299
3
原创 类似stl中排列算法的组合算法
conbination.h //combination.h #ifndef __COMBINATION_H__ #define __COMBINATION_H__ // Non recursive template function template bool next_combination(BidIt n_begin, BidIt n_end, BidIt r_begin, BidIt r
2004-07-10 13:53:00
7904
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人