期刊文献+

基于C++的内部类的实现以及应用 被引量:3

The Implementation and Application of Inner Class Emulation in C++
下载PDF
导出
摘要 多重继承一直是C++语言中一个广受争议的语言特征。一般认为,在面向对象设计中应该谨慎使用多重继承。文章分析了C++中多重继承实现的复杂性并对如何高效使用多重继承进行了探讨。作为替代方案,文中给出了基于内部类的方法以避免多重继承的复杂性,并对内部类机制在面向对象设计中的应用进行了探讨。 Multiple Inheritance(MI) is just another tool in the object-oriented toolbox.Compared to single inheritance,it's typically more complicated to use and more complicated to understand.In this paper,we present the "dark corner" of MI and give guide on how to use MI effectively in OO design.As an ahernative,inner class mechanism can emulate MI cleanly while avoiding the complexity and efficiency drawbacks of MI.we present the inner class emulation in C++ by code sample and discuss the application of inner class in OO design.
出处 《计算机工程与应用》 CSCD 北大核心 2006年第20期92-94,共3页 Computer Engineering and Applications
基金 国家863高技术研究发展计划资助项目(编号:2002AA114020 2001AA135210) 中国科学院知识创新项目资助(编号:20036020)
关键词 内部类 C++ 多重继承 面向对象设计 inner class, C++, Multiple Inheritance,Object-Oriented design
  • 相关文献

参考文献5

  • 1More Exceptional C++:40 New Engineering Puzzles,Programming Problems,and Solutions[C].In:Herb Sutter ed.Addison Wesley,2001-12
  • 2Effective C++:55 Specific Ways to Improve Your Programs and Designs[C].In:Scott Meyers ed.Addison Wesley,2005-05
  • 3Inside the C++ Object Model[C].In:Stanley B Lippman ed.AddisonWesley,1996-05
  • 4The Design and Evolution of C++[C].In:Bjarne Stroustrup ed.Addison-Wesley,1994-03
  • 5Java in a Nutshell[C].In:David Flanagan,O'Reilly eds.4th edition,2002-03

同被引文献20

引证文献3

二级引证文献12

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部