节点文献
C++中运算符重载的应用探讨
Application of operator overloading in C++
【摘要】 多态性是面向对象程序设计的重要支柱之一,而运算符重载又是实现多态性的一个重要途径。运算符重载使得程序员把运算符的使用扩展到操作数是对象的情况,由运算符构成的表达式常常比函数调用更简洁易懂。本文对C++中运算符重载的概念及规则做了概括,对重定义运算符做了说明。
【Abstract】 Polymorphism is an important pole of OPP,and operator overloading is an important path of polymorphism realized.Programmer can define the operator that operator datum are objects.The expression composed of operator is often more laconic and easier to understand than the function.In this paper,the conception and rule of operation overloading is summarized,and how to re-define the operator is explained.
【关键词】 友元函数;
成员函数;
函数重载;
运算符重载;
多态性;
【Key words】 friend function; member function; function overloading; operator overloading; polymorphism;
【Key words】 friend function; member function; function overloading; operator overloading; polymorphism;
- 【文献出处】 南阳师范学院学报 ,Journal of Nanyang Normal University , 编辑部邮箱 ,2006年06期
- 【分类号】TP312.1
- 【下载频次】60