Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-22 11:02:49


On Wed, 22 Jan 2003 11:57:06 -0000, "John Maddock"
<jm_at_[hidden]> wrote:

>> then I say: ok, the idea is that we say "From is convertible To" if
>> and only if the expression From() [5.2.3/2 of the standard] is
>> convertible to To.
>
>No there is no requirement that From be default constructible, (not even in
>the implementation).

Right, sorry. That was just the idea *I* had in mind :-)

>> [...] Incidentally I've noticed that currently
>> is_convertible<void, void> gives true. Is it the intent?
>
>Heaven only knows, that one wasn't me, IMO it probably does make sense in
>that anything is convertible to void as a special case.

It makes sense only if you want it to make sense. That is, like almost
all other cases, it depends on your definition of is_convertible,
which is exactly what we miss. The fact that I had to ask means that
the definition in the documentation is not enough, and that I must *as
a library user* go to look at the implementation to see what happens
in my special case. The problem is that even then I remain in doubt:
is this just a "chance" due to the way they have implemented it or is
it intentional? If they'll change the implementation in the future can
the value be different so that my code is unexpectedly broken?

Genny.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk