std.array suggestion (version 3)

Oskar Linde oskar.lindeREM at OVEgmail.com
Mon Sep 4 04:24:40 PDT 2006


Ivan Senji wrote:
> Oskar Linde wrote:
>> Hi,
>>
>> It's time for version 3 of my std.array suggestion. Some changes:
>>
> <snip>
> 
> Sorry for a little late reply but I have been thinking about your 
> std.array a little and was wondering why restrict ourselves to arrays,
> wouldn't it be better to have std.algorithm that would work on both 
> arrays and user defined types that have opApply or have opIndex and 
> length. It is possible to check those things at compile time.

Sorry for this short reply. I am a little short on time. But you have a 
good point that I have been pursuing lately. It is very possible to make 
the algorithms more generic. In fact, many algorithms should already 
work on any type supplying a length, an opIndex and an opApply. I would 
like to go further by identifying and minimizing the requirements each 
algorithm places on its argument types. Such requirements should then be 
classified into concepts and documented.

/Oskar



More information about the Digitalmars-d mailing list