|
Boost : |
From: Mike Conley (conley.141_at_[hidden])
Date: 2003-04-27 09:25:26
"John Maddock" <john_maddock_at_[hidden]> wrote in
news:010301c30cae$368d7970$0f60d3d4_at_fuji:
> The problem is that the question "is A convertible to B" has four
> answers: yes, no, ill-formed, and ambiguous :-(
>
> John.
Obviously, I think there should be only two :) That is, it would be nice
to have a test that tells me the whether or not an assignment would or
would not succeed. If I want to assign the result of an expression to a
variable (or use it as a return value, etc), I don't particularly care WHY
an assignment would fail. I just want to know whether it would or not.
Perhaps it would be useful to have a set of tests that can tell you whether
a conversion would fail for a specific reason, eg, conversion_is_ambiguous
<X,Y>.
But the real problem, as I see it, is that is_convertible<X,Y> can fail to
compile for certain choices of X and Y. That defeats the purpose of the
test -- why would I ask if I can convert an X to a Y if I must already know
the answer to do so safely?
-- Mike Conley
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk