digitalmars.D - int** should be compatible to void**?
- Katayama Hirofumi MZ (5/5) Jan 22 2014 Hello, this is a Japanese programmer, katahiromz.
- Walter Bright (2/5) Jan 22 2014 While void is untyped data, void* is definitely typed data.
- Kenji Hara (16/21) Jan 22 2014 Because it is definitely unsafe.
- Katayama Hirofumi MZ (2/3) Jan 22 2014
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (7/8) Jan 23 2014 Going off topic, that answers a question of mine! :) I could not be sure...
- Stanislav Blinov (2/4) Jan 23 2014 Maybe you actually did get it wrong? :)
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (3/7) Jan 23 2014 I hope not. :)
- Jakob Ovrum (5/11) Jan 23 2014 All three are equally correct. Whether to use first or last name
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.
Jan 22 2014
On 1/22/2014 12:36 AM, Katayama Hirofumi MZ wrote: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?While void is untyped data, void* is definitely typed data.
Jan 22 2014
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 <katayama.hirofumi.mz gmail.com>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.
Jan 22 2014
Oh, I see. Thanks, Kenji san. On Wednesday, 22 January 2014 at 09:04:31 UTC, Kenji Hara wrote:Because it is definitely unsafe.
Jan 22 2014
On 01/22/2014 01:25 AM, Katayama Hirofumi MZ wrote:Oh, I see. Thanks, Kenji san.Going off topic, that answers a question of mine! :) I could not be sure whether Kenji san, Hara san, or even Hara-san would be correct when I wrote to a Japanese person. Ali P.S. Going even more off topic, that person did not respond to my email yet. ;)
Jan 23 2014
On Thursday, 23 January 2014 at 19:00:45 UTC, Ali Çehreli wrote:P.S. Going even more off topic, that person did not respond to my email yet. ;)Maybe you actually did get it wrong? :)
Jan 23 2014
On 01/23/2014 11:09 AM, Stanislav Blinov wrote:On Thursday, 23 January 2014 at 19:00:45 UTC, Ali Çehreli wrote:I hope not. :) AliP.S. Going even more off topic, that person did not respond to my email yet. ;)Maybe you actually did get it wrong? :)
Jan 23 2014
On Thursday, 23 January 2014 at 19:00:45 UTC, Ali Çehreli wrote:On 01/22/2014 01:25 AM, Katayama Hirofumi MZ wrote:All three are equally correct. Whether to use first or last name is similar to the equivalent split in the anglosphere. Using a hyphen is overwhelmingly common but not required in any system of romanization.Oh, I see. Thanks, Kenji san.Going off topic, that answers a question of mine! :) I could not be sure whether Kenji san, Hara san, or even Hara-san would be correct when I wrote to a Japanese person. Ali
Jan 23 2014