天天看点

(翻译文章)灵活好用的给容器对象赋初值的boost库

序言

翻译作者:dozb

原文作者:Thorsten Ottosen

出处:http://www.codeproject.com/vcpp/stl/PGIL.asp

作者提醒读者,对这个库的深层描述及其实现发表在2003 年10月出版的《C/C++ Users Journal 》,文章“Non-intrusive Container Initialization”. 本文所被采纳的部分已经被提炼并放在boost中等待讨论(见 http://www.boost.org/). 本文中的有关枚举范围的部分没有被采纳。 Having a templated conversion operator can still be tricky for some compilers, but Leor Zolman has managed to port it to a wide range of compilers in his own initilization library (see http://www.bdsoft.com/tools/initutil.html ). 请注意下面的机制更简单,通过调用

container.insert( container.end(), new_value ) )

.

详细内容请访问:http://dozb.blogchina.com/1627498.html

继续阅读