C++ overload resolution
Fri Apr 17 17:32:31 CEST 2009 Tobias Rautenkranz <tobias@rautenkranz.ch>
* C++ overload resolution
diff -rN -u old-doc/introduction.docbook new-doc/introduction.docbook
--- old-doc/introduction.docbook 2014-10-30 06:55:28.000000000 +0100
+++ new-doc/introduction.docbook 2014-10-30 06:55:29.000000000 +0100
@@ -25,8 +25,6 @@
<itemizedlist>
<listitem><para>Bad multithreaded performance
due to a lock for the global hash-tables.</para></listitem>
- <listitem><para>No C++ style argument conversion / overload resolution.</para></listitem>
- <listitem><para>No custom overloading methods by argument count.</para></listitem>
<listitem><para>Limited conversions. E.g. <code>QList&lt;T&gt;</code> is missing.
</para></listitem>
<listitem><para>10 seconds startup time (for <package>qt.examples</package>) on a
diff -rN -u old-doc/smoke.docbook new-doc/smoke.docbook
--- old-doc/smoke.docbook 2014-10-30 06:55:28.000000000 +0100
+++ new-doc/smoke.docbook 2014-10-30 06:55:29.000000000 +0100
@@ -24,7 +24,7 @@
(make-instance '<classname>qt:object</classname>)
</programlisting>
</informalexample>
-Suppy arguments as list to the <code>:args</code> keyword:
+Supply arguments as list to the <code>:args</code> keyword:
<informalexample>
<programlisting>
(let ((parent (make-instance '<classname>qt:object</classname>)))
@@ -54,6 +54,26 @@
<programlisting>(frob my-instance 1)</programlisting>
</informalexample>
</para>
+<section><title>Overload Resolution</title>
+<para>
+C++ style overload resolution with conversion sequences is under development,
+but already usable. For example this:
+<informalexample>
+<programlisting>
+(cxx:set-pen (make-instance '<classname>qt:painter</classname>)
+ (make-instance '<classname>qt:color</classname> :args '("green")))
+</programlisting>
+</informalexample>
+is equivalent to:
+<informalexample>
+<programlisting>
+(cxx:set-pen (make-instance '<classname>qt:painter</classname>) "green")
+</programlisting>
+</informalexample>
+In the second case a temporary <classname>qt:color</classname> instance is implicitly created.
+</para>
+</section>
+
<section><title>defmethod</title>
<para>
You can extend the <package>:cxx</package> generic functions by