Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2003-01-21 08:26:23


>From: "Eric Niebler" <neric_at_[hidden]>

> It seems to me that the current implementation of is_convertible will
> conclude that int* is convertible to int[10]. That's because when a
> function parameter is of array type, it is treated just like a pointer.
But
> according to 4/3 of the standard:
>
> "An expression e can be _implicitly converted_ to a type T if an only if
the
> declaration "T t=e;" is well-formed for some invented variable t (8.5)."
>
> By this definition, int* is not implicitly convertible to int[10]. So it
> seems is_convertible is broken in this regard. IMO, is_convertible<A,B>
> should always return false when B is an array type.

Unless it's an identity conversion, I guess:

is_convertible<int[10],int[10]>::value

Regards,

Terje


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