In the documentation on arrays, under "usage" is mentioned this sequence: int* p; int[3] s; p = s; // p points to the first element of the array s. However, this causes the following message from the compiler: "cannot implicitly convert expression (s) of type int[3] to int*." It seems the documentation needs to be updated. I only stumbled on one of the cases (the above) but there might be more cases that need revisit.
Added URL: http://www.digitalmars.com/d/2.0/arrays.html.
Bug was reported for version 1.007, but it still exists in 2.012.
This bug is filed against a D1 version, so surely the URL given should be to the D1 docs. Also correcting platform and component.
Marking with patch, since this fix is trivial: change p = q; p = s; p = a; to p = q; p = s.ptr; p = a.ptr;
ha-ha, the patch keyword is for bugs that have patch fixing them
I honestly think it'd take longer for Walter to look at, download and apply a 'real patch' than for him to open arrays.dd and add the .ptr to lines 148/149 manually.
The same bug is in the string section: "A pointer to a char can be generated".
Fixed in phobos commit 1663. Don't know how this one stuck around for so long.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル