首页 | 官方网站   微博 | 高级检索  
     

面向对象与泛型编程矛盾论(上)——类型擦除技术在C++中的应用
引用本文:Thomas Becker,罗小平.面向对象与泛型编程矛盾论(上)——类型擦除技术在C++中的应用[J].程序员,2008(3):88-92.
作者姓名:Thomas Becker  罗小平
作者单位:[1]不详 [2]Zephyr Associates公司
摘    要:本文讨论了C++中泛型编程(generic programming)与面向对象设计(object-oriented design)原则的冲突问题,并用实例——any-iterator,一个类型安全、适用于任何类型的C++遍历器——说明了类型擦除(type erasure)技术对此问题的解决办法。

关 键 词:面向对象设计  类型安全  泛型编程  C++  技术  擦除  矛盾论  应用

The Conflicts between OO and Generic Programming(Part 1)
Thomas Becker.The Conflicts between OO and Generic Programming(Part 1)[J].Programmer,2008(3):88-92.
Authors:Thomas Becker
Abstract:The author discusses how the generic programming paradigm in C++ can lead to conflicts with object-oriented design principles.To address this problem,the author depicts a technique calledtype erasurewhich could be used to alleviate these conflicts.An in-depth example is presented,in which it covers any iterator,a type-safe,heterogeneous C++ iterator.
Keywords:
本文献已被 CNKI 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号