operator的详细讲解

来源:百度知道 编辑:UC知道 时间:2024/05/10 06:16:04
越详细越好,重载就不用提了,分不吝啬
尤其是operator()和operator[]

operator关键字就是用于重载的

可以参考roguewave开发库的RWCString类定义,其中有很多operator重载,其中就有[]和()的重载
RWCString

Members:

append()
binaryStoreSize()
byteCount()
capacity()
collate()
compareTo()
const char*()
contains()
data()
first()
hash()
index()
initialCapacity()
insert()
isAscii()
isNull()
last()
length()
match()
maxWaste()
mbLength()
operator()()
operator+=()
operator=()
operator[]()
prepend()
readFile()
readLine()
readString()
readToDelim()
readToken()
remove()
replace()
resize()
resizeIncrement()
rindex()
RWCString()
RWCString::caseCompare
RWCString::scopeType
std()
strip()
subString()
toLower()
toUpper()

Non-Members:

operator!=()
operator>>()
operator>()
operator>=()
operator<<()
operat