Request: a more logical static array behavior

Tommi tommitissari at hotmail.com
Thu Aug 15 07:49:27 PDT 2013


On Thursday, 15 August 2013 at 13:53:17 UTC, Artur Skawina wrote:
> On 08/15/13 14:44, Tommi wrote:
> [...]
>> No, I'm not asking A -> C, I'm just asking that int[3] convert 
>> to int[].
>
>>From you earlier post:
>
>   Ret bar(R)(R r) // [6]
>   if (std.range.isInputRange!R)
>   {
>       return Ret.input_range;
>   }
>
> You'd like to be able to call 'bar' with a static array. 
> Currently
> you can't, because 'R' becomes a /static array/, hence not a 
> input range.
>
> Note that
>
>   Ret baz(R)(R[] r) // [6]
>   if (std.range.isInputRange!(R[]))
>   {
>       return Ret.input_range;
>   }
>
> [..]

To be exact, I want either of the following options (but not both 
of them):

1) I want to be able to call 'bar' with a static array

OR

2) I want to _not_ be able to call 'baz' with a static array

Either one of those options is fine by me. All I want is make D's 
static arrays behave logically (and either one of those options 
would do it).


More information about the Digitalmars-d mailing list