    <rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:content="http://purl.org/rss/1.0/modules/content/">
     <channel>
        <title>ACCU  :: Polymorphism In Object-Oriented Languages</title>
        <link>https://members.accu.org/index.php/articles/538</link>
        <description>Professionalism in Programming</description>
        <dc:language>en-us</dc:language> 
        <dc:creator>Administrator</dc:creator> 
        <admin:generatorAgent rdf:resource="http://www.xaraya.org" /> 
        <admin:errorReportsTo rdf:resource="mailto:webeditor@accu.org" />
       <sy:updatePeriod>hourly</sy:updatePeriod>
       <sy:updateFrequency>1</sy:updateFrequency>
       <docs>http://backend.userland.com/rss</docs>




<div class="xar-mod-head"><span class="xar-mod-title">Design of applications and programs + Overload Journal #32 - Jun 1999</span></div>

<table border="0" cellpadding="1" cellspacing="0">
    <tbody>
    <tr>
        <td valign="top">
            Browse in :
       </td>
       <td valign="top">

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c13/">Topics</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c67/">Design</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/">All</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c76/">Journals</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c78/">Overload</a>

                     &gt;                         <a href="https://members.accu.org/index.php/articles/c172/">32</a>
<br />

                                            <a href="https://members.accu.org/index.php/articles/c67-172/">Any of these categories</a>

                    -                        <a href="https://members.accu.org/index.php/articles/c67+172/">All of these categories</a>
<br />
</td>
   </tr>
   </tbody>
</table>




<div class="xar-error">
   <p>
 <strong>Note:</strong> when you create a new publication type,
the articles module will automatically use the templates
<em>user-display-[publicationtype].xt</em>
and <em>user-summary-[publicationtype].xt</em>.
If those templates do not exist when you try to preview or display a new article,
you'll get this warning :-)  Please place your own templates in themes/<em>yourtheme</em>/modules/articles . The templates will get the extension .xt there. </p>
</div>
<div class="xar-norm xar-standard-box-padding">
   <h1><strong>Title:</strong>&nbsp;Polymorphism In Object-Oriented Languages</h1>
<p><strong>Author:</strong>&nbsp;</p>
<p>
<strong>Date:</strong> 26 June 1999 17:50:53 +01:00 or Sat, 26 June 1999 17:50:53 +01:00</p>
<p><strong>Summary:</strong>&nbsp;</p>
<p><strong>Body:</strong>&nbsp;<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e22" id=
"d0e22"></a>Introduction</h2>
</div>
<p>Polymorphism is a complex feature especially, but not only, of
object-oriented programming. It interacts with other language
features. Thus, it is useful to take a look at the other concepts
of object-oriented programming:</p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>encapsulation,</p>
</li>
<li>
<p>class,</p>
</li>
<li>
<p>attribute,</p>
</li>
<li>
<p>method,</p>
</li>
<li>
<p>exemplar,</p>
</li>
<li>
<p>message,</p>
</li>
<li>
<p>inheritance, and</p>
</li>
<li>
<p>object identity.</p>
</li>
</ul>
</div>
<p><span class="emphasis"><em>Encapsulation</em></span> means that
data and appropriate functions form a whole. It is usually combined
with <span class="emphasis"><em>information hiding</em></span>. The
data of an object are completely hidden. They can be accessed only
by using the functions defined for the object. Both principles were
introduced by the concept of <span class="emphasis"><em>Abstract
Data Type</em></span> (ADT, fig. 1).</p>
<div class="figure"><a name="d0e62" id="d0e62"></a>
<div class="mediaobject c3"><img src=
"/var/uploads/journals/resources/Eisenecker_fig1.png" align="middle" alt=
"From data and functions to an Abstract Data Type"></div>
<p class="title c4">Figure 1. From data and functions to an
Abstract Data Type</p>
</div>
<p>The class serves as a blue-print for objects. It defines the
attributes and functions of an object. The data of an object are
called <span class="emphasis"><em>attributes</em></span> and its
functions are called <span class=
"emphasis"><em>methods</em></span>. The object created from a
blue-print is called exemplar or instance (fig. 2). All exemplars
of a class share all their methods, but each instance has its own
set of data<sup>[<a name="d0e76" href="#ftn.d0e76" id=
"d0e76">1</a>]</sup>.</p>
<div class="figure"><a name="d0e92" id="d0e92"></a>
<div class="mediaobject c3"><img src=
"/var/uploads/journals/resources/Eisenecker_fig2.png" align="middle" alt=
"A class and its exemplars"></div>
<p class="title c4">Figure 2. A class and its exemplars</p>
</div>
<p>An exemplar is activated by sending a <span class=
"emphasis"><em>message</em></span>. If the exemplar does understand
the message, the appropriate method is executed (fig. 3). There are
a number of synonyms for message in other object-oriented
programming and modeling languages.</p>
<div class="figure"><a name="d0e103" id="d0e103"></a>
<div class="mediaobject c3"><img src=
"/var/uploads/journals/resources/Eisenecker_fig3.png" align="middle" alt=
"Messages and methods"></div>
<p class="title c4">Figure 3. Messages and methods</p>
</div>
<p>With <span class="emphasis"><em>inheritance</em></span> it is
not necessary to define a new class entirely from scratch. Instead
it can be derived from an existing class (fig. 4). A general rule
of object-oriented programming is that derived classes can define
new attributes and new methods. It is not possible to get rid of
inherited attributes and methods. But the implementation of an
inherited method can be replaced by a new implementation. This is
called <span class="emphasis"><em>overriding</em></span>.
Inheritance can be applied for reuse. In statically typed
programming languages, a class defines also a type. In these
languages, a derived class is a subtype of the supertype which is
defined by the base class. Subtypes are normally compatible to
their supertypes. Inheritance is often overemphasized in
literature. But polymorphism is of greater importance since it
helps to reduce dependencies. On the contrary, inheritance
sometimes introduces even harmful dependencies between classes.</p>
<div class="figure"><a name="d0e117" id="d0e117"></a>
<div class="mediaobject c3"><img src=
"/var/uploads/journals/resources/Eisenecker_fig4.png" align="middle" alt=
"Inheritance"></div>
<p class="title c4">Figure 4. Inheritance</p>
</div>
<p><span class="emphasis"><em>Object identity</em></span> means
that each exemplar is unique and thus can be distinguished from
others. There are many ways to realize object identity.</p>
<p>Due to the limited space, this introduction can not go into more
detail. For a deeper insight and a profound criticism of
object-oriented concepts the reader is referred to [<a href=
"#Eis96">Eis96</a>]. The following sections exclusively focus on
polymorphism.</p>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e132" id="d0e132"></a>Schema of
Cardelli and Wegner</h2>
</div>
<p>In object-oriented programming, <span class=
"emphasis"><em>polymorphism</em></span> (from Greek: &quot;occurring in
many forms&quot;) means that different exemplars respond to the same
message by executing the appropriate method.</p>
<p>Cardelli and Wegner [<a href="#CW85">CW85</a>] examine
polymorphism from the perspective of language design (fig. 5). They
distinguish <span class="emphasis"><em>universal</em></span> and
<span class="emphasis"><em>ad-hoc polymorphism</em></span> as
high-level categories. In universal polymorphism, the same code
applies to different types. In ad-hoc polymorphism, different code
may be executed for different types. <span class=
"emphasis"><em>Parametric polymorphism</em></span> requires type
parameters, e.g. templates in C++ or generics in Ada. Parametric
polymorphism is the heart of generic programming. <span class=
"emphasis"><em>Inclusion polymorphism</em></span> relies on
inheritance and subtyping. Both forms of polymorphism will be
discussed in detail below.</p>
<p><span class="emphasis"><em>Overloading</em></span> means that
functions of the same name may be implemented differently for
different types. E.g. the operator &quot;+&quot; has different
implementations for adding integral numbers and for adding floating
point numbers. Coercion is the automatic application of built-in or
user-defined type conversions. E.g. when adding an integral and a
floating point number the integral number is promoted automatically
to a floating point number by the compiler. Overloading and
coercion may conflict if an appropriate conversion and an
overloaded function are available at the same time.</p>
<div class="figure"><a name="d0e161" id="d0e161"></a>
<div class="mediaobject c3"><img src=
"/var/uploads/journals/resources/Eisenecker_fig5.png" align="middle" alt=
"Schema of Cardelli and Wegner [CW85]"></div>
<p class="title c4">Figure 5. Schema of Cardelli and Wegner
[<a href="#CW85">CW85</a>]</p>
</div>
</div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e170" id="d0e170"></a>Polymorphism
in C++</h2>
</div>
<p>C++ offers all forms of polymorphism described by Cardelli and
Wegner. C++ allows overloading of functions or methods and
user-defined type conversions. Both parametric and inclusion
polymorphism are relevant for object-oriented programming.
Templates are used for parametric programming in C++ (listing 1).
The template function <tt class="literal">test&lt;&gt;()</tt>
defines the common code to be used with the template parameter
<tt class="type">T</tt><sup>[<a name="d0e180" href="#ftn.d0e180"
id="d0e180">2</a>]</sup>. <tt class="type">T</tt> can be
substituted by any of class <tt class="classname">A</tt> or
<tt class="classname">B</tt>. The substituting classes do not need
to be related by inheritance. Hence inheritance is not relevant
here. From the perspective of <tt class=
"literal">test&lt;&gt;()</tt> it is only important that the
function <tt class="function">hello()</tt> is defined for the
actual parameter of <tt class="type">T</tt>. This is verified
during compile or link time. Calling <tt class=
"literal">hello&lt;&gt;()</tt> is bound statically. Hence an error
will be reported before run time.</p>
<p><span class="bold"><b>Listing 1: Parametric polymorphism in
C++</b></span></p>
<pre class="programlisting">
class A
{ public:
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of A&quot; &lt;&lt; endl; 
   }
}; 
class B 
{ public:
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of B&quot; &lt;&lt; endl; 
   } 
};
template &lt;class T&gt;
void test(const T&amp; v) 
{ v.hello(); 
};
// ... 
A a; 
B b;
test(a);
test(b);
</pre>
<p>Inclusion polymorphism has three requirements in C++ (listing
2): </p>
<div class="itemizedlist">
<ul type="disc">
<li>
<p>Inheritance,</p>
</li>
<li>
<p>virtual functions, and</p>
</li>
<li>
<p>and call by reference or call by pointer.</p>
</li>
</ul>
</div>
<p>Class <tt class="classname">A</tt> defines a virtual function
<tt class="methodname">hello()</tt>. Class <tt class=
"classname">B</tt> is derived from <tt class="classname">A</tt> and
overwrites the inherited implementation of <tt class=
"methodname">hello()</tt>. An exemplar of <tt class=
"classname">A</tt> or a derived class is passed to the function
<tt class="methodname">test()</tt> by reference<sup>[<a name=
"d0e248" href="#ftn.d0e248" id="d0e248">3</a>]</sup>. Depending on
the class of the actual exemplar during run time, the appropriate
implementation of <tt class="methodname">hello()</tt> is selected
and executed. This technique is called late or dynamic binding.
Even in this case the compiler can detect errors. Only if
<tt class="classname">B</tt> is a subtype of <tt class=
"classname">A</tt>, i.e. it is derived publicly, an implementation
of <tt class="methodname">hello()</tt> is available. The compiler
would report a type error if <tt class="classname">B</tt> was not a
direct or indirect descendant of <tt class="classname">A</tt>.
Obviously inclusion polymorphism interacts closely with the type
system and inheritance. A further discussion of parametric and
inclusion polymorphism can be found in [<a href=
"#Eis95">Eis95</a>].</p>
<p><span class="bold"><b>Listing 2: Inclusion polymorphism in
C++</b></span></p>
<pre class="programlisting">
class A
{ public:
   virtual void hello() const 
   { cout &lt;&lt; &quot;Exemplar of A&quot; &lt;&lt; endl; 
   } 
};
class B: public A 
{ public: 
   void hello() const
   { cout &lt;&lt; &quot;Exemplar of B&quot; &lt;&lt; endl; 
   } 
};
void test(const A&amp; v) 
{ v.hello(); 
};
// ...

A a; 
B b; 
test(a); 
test(b); 
</pre>
<p>Variations of the preceding example will be used to demonstrate
overloading and coercion. Overloading requires different
implementations of <tt class="methodname">test()</tt> for
<tt class="classname">A</tt> and <tt class="classname">B</tt>
(listing 3). As with parametric polymorphism inheritance is not
relevant here. It is important to note that even <tt class=
"methodname">hello()</tt> must not be present in both classes.
Having <tt class="methodname">hello()</tt> in <tt class=
"classname">A</tt> and <tt class="methodname">hi()</tt> in
<tt class="classname">B</tt> we could implement <tt class=
"methodname">test(const A&amp; a)</tt> as <tt class=
"methodname">a.hello()</tt> and <tt class="methodname">test(const
B&amp; b)</tt> as <tt class="methodname">b.hi()</tt>. Depending on
the actual type of the parameter the compiler selects the
appropriate implementation of <tt class="methodname">test()</tt>.
If no <tt class="methodname">test()</tt>-function matches (and
coercion does not apply), an error will be reported at compile
time.</p>
<p><span class="bold"><b>Listing 3: Overloading in
C++</b></span></p>
<pre class="programlisting">
class A
{ public:
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of A&quot; &lt;&lt; endl; 
   }
}; 

class B 
{ public:
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of B&quot; &lt;&lt; endl; 
   } 
};

void test(const A&amp; v) 
{ v.hello(); 
};

void test(const B&amp; v) 
{ v.hello(); 
};

// ...
A a; 
B b;
test(a);
test(b);
</pre>
<p>In coercion polymorphism we have only one implementation of
<tt class="methodname">test()</tt>, e.g. using <tt class=
"classname">A</tt> as the type of its parameter. Now there are two
mutual exclusive ways to implement coercion. We have to provide
either a type conversion constructor in <tt class=
"classname">A</tt> which takes a <tt class="classname">B</tt> as
argument and creates an <tt class="classname">A</tt> (listing 4) or
a type conversion operator in <tt class="classname">B</tt> which
returns an <tt class="classname">A</tt> if needed (listing 5). If
both forms of conversion are present the compiler can not resolve
this conflict and reports an error.</p>
<p><span class="bold"><b>Listing 4: Coercion in C++ using a type
conversion constructor</b></span></p>
<pre class="programlisting">
class B 
{ public:
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of B&quot; &lt;&lt; endl; 
   } 
};

class A
{ public:
   A(const B&amp;) {} // type conversion constructor
   A() {}         // standard constructor
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of A&quot; &lt;&lt; endl; 
   }
}; 

void test(const A&amp; v) 
{ v.hello(); 
};

// ...
A a; 
B b;
test(a);
test(b); // b &quot;changes&quot; to an A here
</pre>
<p><span class="bold"><b>Listing 5: Coercion in C++ using a type
conversion operator</b></span></p>
<pre class="programlisting">
class A
{ public:
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of A&quot; &lt;&lt; endl; 
   }
}; 

class B 
{ public:
   void hello() const 
   { cout &lt;&lt; &quot;Exemplar of B&quot; &lt;&lt; endl; 
   } 
   operator A() const
   { return A(); // return an A
   }
};

void test(const A&amp; v) 
{ v.hello(); 
};

// ...

A a; 
B b;
test(a);
test(b); // b &quot;changes&quot; to an A here
</pre></div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e360" id="d0e360"></a>Polymorphism
in Java</h2>
</div>
<p>Java offers only inclusion polymorphism which works exactly as
in C++. In Java all classes are either direct or indirect
descendants of the common base class <tt class=
"classname">Object</tt>. Hence all exemplars understand the
messages defined for <tt class="classname">Object</tt>. Listing 6
shows some obvious differences between C++ and Java. In Java every
method is virtual by default. Objects are always passed by
reference and there are no free functions. There are several
proposals for introducing parametric polymorphism into Java
[<a href="#EC98">EC98</a>].</p>
<p><span class="bold"><b>Listing 6: Inclusion polymorphism in
Java</b></span></p>
<pre class="programlisting">
class A { 
  public void hello() { 
    System.out.println(&quot;Exemplar of A&quot;); 
  } 
}
class B extends A { 
  public void hello() { 
    System.out.println(&quot;Exemplar of B&quot;); 
  } 
}
class Test { 
  public static void execute(A a) { 
    a.hello(); 
  } 
}
public class TestApp { 
  public static void main(String[] args) { 
    A a = new A(); 
    B b = new B(); 
    Test.execute(a); 
    Test.execute(b); 
  } 
}
</pre></div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e379" id="d0e379"></a>Polymorphism
in Smalltalk</h2>
</div>
<p>The situation is different in Smalltalk (listing 6). If a
Smalltalk-object receives a message it checks whether it
understands the message. If it does, the appropriate method is
executed otherwise an exception is raised. In Smalltalk, a message
consists of one or more keywords. The complete message forms the
<span class="emphasis"><em>selector</em></span> which corresponds
to a <span class="emphasis"><em>signature</em></span>. Methods with
the same signature can be implemented in independent classes, e.g.
<tt class="methodname">A&gt;&gt;hello</tt> and <tt class=
"methodname">B&gt;&gt;hello</tt>. Even if class <tt class=
"classname">Object</tt> is a common ancestor of every class in
Smalltalk, <tt class="classname">A</tt> and <tt class=
"classname">B</tt> have no common base class which implements
<tt class="methodname">hello</tt>. During run time, a variable may
hold exemplars of any of these classes and it will behave correctly
when receiving the message <tt class="methodname">hello</tt>. This
form of polymorphism does not depend on a type system or
inheritance. It is verified during run time whether a message is
known to the receiving object. Hence the compiler can not detect if
inappropriate messages are sent to objects. This special form of
polymorphism is called <span class="emphasis"><em>signature-based
polymorphism</em></span> as opposed to inclusion polymorphism which
is also referred to as <span class="emphasis"><em>inheritance-bound
polymorphism</em></span> [<a href="#Eis93">Eis93</a>]. In
Smalltalk, every method is in some sense &quot;generic&quot; as C++ templates
except that it works at run time too.</p>
<p><span class="bold"><b>Listing 6: Polymorphism in
Smalltalk</b></span></p>
<pre class="programlisting">
A&gt;&gt;hello &quot;A inherits from Object - Object does not implement 'hello'&quot; 
    Transcript show: 'Exemplar of A'; cr
B&gt;&gt;hello &quot;A inherits from Object - Object does not implement 'hello'&quot; 
    Transcript show: 'Exemplar of B'; cr
&quot;Execute the following code:&quot;
| v | 
v := A new. 
v hello. 
v := B new. 
v hello 
</pre></div>
<div class="sect1" lang="en">
<div class="titlepage">
<h2><a name="d0e425" id="d0e425"></a>Summary and
Criticism</h2>
</div>
<p>Polymorphism is an essential feature of object-oriented
programming. It comes in several variants and interacts with other
language features. The schema of Cardelli and Wegner is well-suited
for classifying the various forms of polymorphism in typed
languages. But the polymorphism of Smalltalk does not fit into this
taxonomy because in some way it combines parametric and inclusion
polymorphism by excluding static type checking. This has the
consequence that object-oriented design models can be simplified
when they are implemented in Smalltalk. The reason is that abstract
base classes or interface classes can be omitted entirely. Thus,
coupling and complexity of the model are reduced since dependencies
of classes due to inheritance relations are eliminated.</p>
<p>It is worth to note that nearly all object-oriented analysis and
design methods are implicitly based on inclusion polymorphism or
the complete Cardelli/Wegner schema. E.g. the UML offers abstract
and parameterized classes. Thus UML-based design models can be
easily implemented in C++. For Java it must be decided how to
implement the parameterized classes of the UML-model. Using
Smalltalk the model can be simplified since abstract and
parameterized classes are not required.</p>
</div>
<div class="bibliography">
<div class="titlepage">
<h2><a name="d0e432" id="d0e432"></a>References</h2>
</div>
<div class="bibliomixed"><a name="CW85" id="CW85"></a>
<p class="bibliomixed">[CW85] Luca Cardelli and Peter Wegner: On
Understanding Types, Data Abstraction and Polymorphism. Computing
Surveys, vol. 17, no. 4, December 1985, pp. 471-522</p>
</div>
<div class="bibliomixed"><a name="EC98" id="EC98"></a>
<p class="bibliomixed">[EC98] Ulrich W. Eisenecker and Krzysztof
Czarnecki: Generische Programmierung in Java. JavaSpektrum 6/1998,
pp. 34-46</p>
</div>
<div class="bibliomixed"><a name="Eis93" id="Eis93"></a>
<p class="bibliomixed">[Eis93] Ulrich W. Eisenecker:
Objektorientierung und Wiederverwendbarkeit. In: unix/mail 6/93,
pp. 420-429</p>
</div>
<div class="bibliomixed"><a name="Eis95" id="Eis95"></a>
<p class="bibliomixed">[Eis95] Ulrich W. Eisenecker: Typisierung
und Polymorphie in C++. OBJEKTspektrum 5/1995, pp. 81-83,
<span class="bibliomisc"><a href=
"http://home.t-online.de/home/Ulrich.Eisenecker/cppcol02.htm"
target=
"_top">http://home.t-online.de/home/Ulrich.Eisenecker/cppcol02.htm</a></span></p>
</div>
<div class="bibliomixed"><a name="Eis96" id="Eis96"></a>
<p class="bibliomixed">[Eis96] Ulrich W. Eisenecker: Grundlagen der
Objektorientierung kritisch betrachtet. Talk, GI-Regionalgruppe,
Heidelberg 1996, <span class="bibliomisc"><a href=
"http://www.fh-heidelberg.de/public/eiseneck/ookritik.zip" target=
"_top">http://www.fh-heidelberg.de/public/eiseneck/ookritik.zip</a></span></p>
</div>
<div class="bibliomixed"><a name="GHJV96" id="GHJV96"></a>
<p class="bibliomixed">[GHJV96] Erich Gamma, Richard Helm, Ralph
Johnson, and John Vlissides: Design Patterns. Addison-Wesley
1995</p>
</div>
<div class="bibliomixed"><a name="MKE92" id="MKE92"></a>
<p class="bibliomixed">[MKE92] Antonin Mr&aacute;zik, Janka
Kleinertov&aacute;, and Ulrich W. Eisenecker: Welten &agrave; la
OOP. Die Theorie der P-Systeme. In: c't 3/1992, pp. 202-209.</p>
</div>
</div>
<div class="footnotes"><br>
<hr class="c5" width="100">
<div class="footnote">
<p><sup>[<a name="ftn.d0e76" href="#d0e76" id=
"ftn.d0e76">1</a>]</sup> In addition to <span class=
"emphasis"><em>class</em></span>/<span class=
"emphasis"><em>instance-based</em></span> programming languages,
there are also <span class=
"emphasis"><em>prototype-based</em></span> languages [<a href=
"#MKE92">MKE92</a>]. They are not discussed here.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e180" href="#d0e180" id=
"ftn.d0e180">2</a>]</sup> More precisely, the code of the template
is normally duplicated by the compiler during instantiation. This
may lead to the so called <span class="emphasis"><em>code
bloat</em></span> problem.</p>
</div>
<div class="footnote">
<p><sup>[<a name="ftn.d0e248" href="#d0e248" id=
"ftn.d0e248">3</a>]</sup> Instead of passing the object by
reference, a pointer to the object can be passed. In both cases the
object is not copied. If the object was passed by value, it would
be copied. If the types of the passed object and of the value copy
are different, the compiler performs a type conversion (provided a
subtype relationship exists and a type conversion operator or a
type conversion constructor is available). Hence, the polymorphic
type of an object gets lost if it is passed by value.</p>
</div>
</div>
</p>
<p><strong>Notes:</strong>&nbsp;</p>
<p><em>More fields may be available via dynamicdata ..</em></p>
</div>
</channel>
</rss>
