Yurttas/PL/OOL/Cplusplus/F/03/02/02/00/09/index page
Dr. Salih Yurttas - yurttas@zcubes.com
programming languages - design principles, implementation constructs
c++
- abstraction mechanisms: classes and operator overloading
- class/object construction - operator overloading
- V - [ vector class with OCCF and operator overloading ] default values for default constructor
and operator[], operator+ is overloaded[] can be used both in lhs and rhs.+ is implemented as a friend function so that it is with two parameters. lhs is non-mutable.
[you can not make friend functions "const" since they are not member-functions
and their access is limited to read-only to private data.]
return type is object and temp object is returned.V.cpp won't compile successfully since it uses friend function as const.
- V - [ vector class with OCCF and operator overloading ] default values for default constructor
- class/object construction - operator overloading
1 | basic facilities << 3 >> class derivation | 5 | 6 | 7 | 8