Initial feedback for std.experimental.image

Manu via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 7 01:50:30 PDT 2015


On 7 July 2015 at 01:34, ponce via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Monday, 6 July 2015 at 13:48:53 UTC, Rikki Cattermole wrote:
>>
>> If reviewing the code itself is too much of a hassel, please review the
>> specification document.
>> http://cattermole.co.nz/phobosImage/docs/html/std_experimental_image_specification.html
>>
>
>
>> Use the Cartesian coordinates system using two (X and Y) size_t integers
>
>
> Why not just int? There is preciously little addressable images beyond 2^31.
> size_t has a variable size and is a source of build breaking.
> Also, please no unsigned integers! This create all manners of bugs because
> of how integer promotion work.

size_t doesn't quietly cast to int. Most iterators are already size_t.
Indexes shoulds be size_t for conventions sake, otherwise you case
everywhere.
Indices should be unsigned, otherwise you need to do 2 tests for
validity, rather than just one; (x >= 0 && x < length) rather than
just (x < length).


More information about the Digitalmars-d mailing list