2009年9月12日

摘要: Recently I worked on a cpp code beatifier, it reads in a cpp file, analysis the content and beautify the format, then write the file back. In my code there's a function like this: void beautify_a_fil... 阅读全文
posted @ 2009-09-12 20:55 Tactoth 阅读(195) 评论(0) 推荐(0) 编辑
摘要: I've heard many people say auto_ptr is very error-proven. The main issue is the assign operator, for underlying it's a swap. I believe this is a design mistake too: auo_ptr should have disabled copy c... 阅读全文
posted @ 2009-09-12 20:53 Tactoth 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Look at this code: string* ps=new string("hello, world"); As is known this code first allocate a memory block of sizeof(string), then call string’s constructor to "make the memory be a string object... 阅读全文
posted @ 2009-09-12 20:51 Tactoth 阅读(138) 评论(0) 推荐(0) 编辑
摘要: No loop, no EOF test. Just one line: ifstream ifs("test.txt");string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()); ========================================... 阅读全文
posted @ 2009-09-12 20:48 Tactoth 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 偶尔发现QQ上有两位好友的签名都是: “临渊羡渔,不如退而结网” 为了保持本人特立独行的传统美德,特意将QQ签名改为: “退而结网,不如临渊羡鱼” 注意由于本人的诸多良好习惯之一,已经成功的将“渔”错打为“鱼”。但我的本意还是“渔”。Tactoth这样讲,自然也不可避免的带了些超级深邃莫测无敌的寓意在其中:你怎么知道人家都是用网的呢?说不定人家用机关枪扫鱼呢!通过这句话,Tactoth意在... 阅读全文
posted @ 2009-09-12 10:15 Tactoth 阅读(293) 评论(0) 推荐(1) 编辑

导航