Policy Adaptors and the Boost Iterator Adaptor Library.pdf
Abstract. The iterator abstraction is one of the most commonly used in programming, but implementing an iterator type can be challenging. The requirements for a standard-conforming iterator are at once tedious and subtle: tedious because much of an iterator’s rich interface is “boilerplate” surrounding a few core operations, and subtle because of the intricate details involved in getting that interface right. This paper presents the generalized iterator template from the Boost Iterator Adaptor Library. In addition to automating the error-prone and redundant job of implementing new iterator types, the library simplifies the creation of iterator types that are variations on other iterators (adapted iterators) and generators of new iterator families (iterator adaptors). The Iterator Adaptor Library is an example of policy-based design and employs template meta-programming. We also present the Policy Adapter implementation pattern, a strategy which can also be used to generate new representatives of other abstract concept families.
- 粉丝: 0
- 资源: 5
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助