Yurttas/PL/OOL/Cplusplus/F/03/02/00/02.html

Revision as of 22:05, 6 November 2013 by MassBot1 (talk | contribs) (Created page with "<div class="divone"><span class="h4"> [http://wiki.zcubes.com/yurttas/ Dr.Salih Yurttas ] - [mailto:yurttas@zcubes.com yurttas@zcubes.com] </span></div><div class="divone"><...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
programming languages - design principles, implementation constructs
c++

  1. abstraction mechanisms: classes and operator overloading
    1. operator overloading
      1. basic rules - binary and unary operators
        • binary operators - [ +, +=, == ]
          • a binary operator can be defined either a member function taking one argument or a friend function taking two arguments.
          • for any binary operator @, aa@bb can be interpreted as either aa.operator@(bb) or operator@(aa,bb).
          • if both are defined, aa@bb is an error.
        • unary operators - [ -, &, [] ]
          • a unary operator, whether prefix or postfix, can be defined either a member function taking no argument or a friend function taking one argument.
          • for any unary operator @, both aa@ and @aa can be interpreted as either aa.operator@() or operator@(aa).
          • if both are defined, aa@ and @aa are errors.

<< | >>


1 | basic facilities << 3 >> class derivation | 5 | 6 | 7 | 8