Newbie GDC issues

Ramon spam at thanks.no
Thu Sep 5 17:59:30 PDT 2013


On Thursday, 5 September 2013 at 23:58:06 UTC, H. S. Teoh wrote:

Thanks and

> @Iain: on that note, it looks like gdb thinks it's debugging 
> C++, but D
> doesn't have anything called 'operator[]'. It would be Really 
> Nice if we
> could somehow coax gdb to use opIndex instead (though it 
> doesn't really
> help in the case of dyn arrays 'cos they are built-in, and don't
> actually have any opIndex to speak of).

I'm not so sure.

Observation:

> print someDynArray.length
10                               // works

char[5] cArray = "Hello";        // Let's try C like fixed length 
array

> print cArray[3]
'l'                              // works

I'm not that sure dyn arrays have no [] (or index or whatever 
it's called) operator. In the end they are just arrays with smart 
housekeeping behind the curtains and some methods (like "length").

I'm looking forward to hear and learn from Iain.

A+ -R


More information about the D.gnu mailing list