Because it is definitely unsafe.
void main()
{
int n;
int* pn = &n;
int** ppn = &pn;
void** ppv = ppn; // if this is allowed...?
double x;
double* px = &x;
// double* is implicitly convertible to void*
*ppv = px;
// Wow, now int** points the double* data!
assert(*ppn is cast(void*)px);
}
Kenji Hara
2014/1/22 Katayama Hirofumi MZ <[email protected]>
> Hello, this is a Japanese programmer, katahiromz.
>
> If TYPE1 was compatible to TYPE2, I think TYPE1* should be compatible to
> TYPE2*.
>
> Why isn't int** type compatible to void** type?
>
> What's your idea? Thanks.
>