摘要
多态性是面向对象程序设计的重要支柱之一,而运算符重载又是实现多态性的一个重要途径。运算符重载使得程序员把运算符的使用扩展到操作数是对象的情况,由运算符构成的表达式常常比函数调用更简洁易懂。本文对C++中运算符重载的概念及规则做了概括,对重定义运算符做了说明。
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.
出处
《南阳师范学院学报》
CAS
2006年第6期81-84,共4页
Journal of Nanyang Normal University
关键词
友元函数
成员函数
函数重载
运算符重载
多态性
friend function
member function
function overloading
operator overloading
polymorphism