Lints, Condate and bugs
Walter Bright
newshound2 at digitalmars.com
Wed Oct 27 02:53:23 PDT 2010
Don wrote:
> I would strongly support that. But it doesn't really work.
> The problem is size_t. The fact that it's unsigned is a root of all
> kinds of evil. It means .length is unsigned!!!
> Personally I think that any creation or access to an object which is
> larger in size than half the memory space, should be impossible without
> a special function call. Providing syntax sugar for this incredibly rare
> scenario introduces a plethora of bugs.
size_t is unsigned to line up with C's. ptrdiff_t is the signed version. You can
do things like:
ptrdiff_t d = a.length;
Making size_t signed would have consequences that are largely unknown.
More information about the Digitalmars-d
mailing list