posts - 2,comments - 0,trackbacks - 0
Boost 在 2月8号发怖了 1.38.0,里面新增了3个库,Flyweight、ScopeExit及Swap。里面让过我最感动的库就是Flyweight 〈http://www.boost.org/doc/libs/1_38_0/libs/flyweight/doc/index.html〉。我想看过 GoF 的设计模式里的Flyweight pattern 对 Flyweight 这个模式一定不陌生,也知道它的重点是节约内存。我自己也实现过一个 StringResource class,利用了 std::map (rbtree) 及 boost::shared_ptr<std::string> 来节约字串在内存的消耗。但看了 boost flyweight 给的 performance report 〈http://www.boost.org/doc/libs/1_38_0/libs/flyweight/doc/performance.html〉及不改变原使 string class 的操作行为,我想我可以把我写的 StringResource class替换了。
posted on 2009-03-31 23:13 Nash Tsai 阅读(983) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理