|
Archives
D Programming
DD.gnu digitalmars.D digitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D - implicit conversions between array and pointer
int* p; int[] a=[1,2,3]; p=a; spec says it should compile, but it won't. Where is the bug - in spec or in compiler. Apr 25 2008
terranium schrieb:int* p; int[] a=[1,2,3]; p=a; spec says it should compile, but it won't. Where is the bug - in spec or in compiler. Apr 25 2008
On 25/04/2008, terranium <terranium yandex.ru> wrote:int* p; int[] a=[1,2,3]; p=a; spec says it should compile, but it won't. Where is the bug - in spec or in compiler. Apr 25 2008
Hmm... It's ref types, they are casted differently. Apr 25 2008
"terranium" <terranium yandex.ru> wrote in message news:futcip$peg$1 digitalmars.com...int* p; int[] a=[1,2,3]; p=a; spec says it should compile, but it won't. Where is the bug - in spec or in compiler. Apr 26 2008
You must be looking at a terribly out-of-date spec. http://www.digitalmars.com/d/1.0/arrays.html See the "Implicit conversions" section. As was mentioned, implicit conversion from T[] to T* was removed more than a year ago. Apr 26 2008
|