Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Interfacing C++ and Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jean-Marc Alliot <alliot@r...>
Subject: Re: Overloading again (Was Re: [Caml-list] Interfacing C++ and Ocaml)
Fergus Henderson wrote:

> This example is a bogus example, since C++ doesn't allow that kind of
> overloading.  C++ requires that every overloaded operator have at least
> one parameter whose type is a class, or a reference to a class,
> an enumeration, or a reference to an enumeration (see e.g. 13.1.1.2
> in the C++ standard).  In this case the argument has pointer type,
> so it can't call an overloaded operator.
>

Right, it was back from a fragment of my memory. The example was slightly more
complex, but took as much time to be debugged.

>
> My opinion with regard to overloading is that what is really
> problematic about overloading in C++ is the *combination* of
> overloading and implicit conversions.

Yes (in C++ it is much more horrible because of implicit conversions) and no : it
is also bad in language like Ada (yes not ADA, right again, sorry lady Lovelace).
It is in fact forbidden to use overloading by many quality manuals, (and so is the
USE directive for example).  I hated that quality manual in the beginning, I now
consider that it is not as terrible as I thought when I was younger. From your
mail, I would say you're younger than I am... :-)


--
|             Jean-Marc Alliot          |
|  http://www.recherche.enac.fr/~alliot |
|         alliot@recherche.enac.fr      |



-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr